core: Use the public constructor of ClientCapabilitiesDTO

In the ApiClient, the constructor without arguments was used to create a
ClientCapabilitiesDTO. Since this constructor has been made private,
ApiClient now uses the other public constructor to allow the code to
compile once again.
This commit is contained in:
Chris Josten 2021-10-25 16:11:10 +02:00
parent 852e3e928f
commit deada4f635
1 changed files with 6 additions and 6 deletions

View File

@ -254,6 +254,7 @@ QNetworkReply *ApiClient::post(const QString &path, const QByteArray &data, cons
req.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
addBaseRequestHeaders(req, path, params);
qDebug() << "POST " << req.url();
qDebug() << " DATA: " << data;
if (data.isEmpty())
return m_naManager.post(req, QByteArray());
else {
@ -430,16 +431,15 @@ void ApiClient::generateDeviceProfile() {
deviceProfile->setMaxStreamingBitrate(d->settings->maxStreamingBitRate());
d->deviceProfile = deviceProfile;
QSharedPointer<DTO::ClientCapabilitiesDto> clientCapabilities = QSharedPointer<DTO::ClientCapabilitiesDto>::create();
QSharedPointer<DTO::ClientCapabilitiesDto> clientCapabilities = QSharedPointer<DTO::ClientCapabilitiesDto>::create(true, // supports mediaControl
false, // supports content uploading
true, // supports persistent identifier
false, // supports sync
deviceProfile);
clientCapabilities->setPlayableMediaTypes({"Audio", "Video", "Photo"});
clientCapabilities->setDeviceProfile(deviceProfile);
clientCapabilities->setSupportedCommands(d->supportedCommands);
clientCapabilities->setAppStoreUrl("https://chris.netsoj.nl/projects/harbour-sailfin");
clientCapabilities->setIconUrl("https://chris.netsoj.nl/static/img/logo.png");
clientCapabilities->setSupportsPersistentIdentifier(true);
clientCapabilities->setSupportsSync(false);
clientCapabilities->setSupportsMediaControl(true);
clientCapabilities->setSupportsContentUploading(false);
d->clientCapabilities = clientCapabilities;
emit deviceProfileChanged();