Skip to content

Commit

Permalink
BUMP VERSION 0.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HenkKalkwater committed Sep 26, 2020
1 parent 02f73fe commit edb514b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
3 changes: 3 additions & 0 deletions harbour-sailfin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ QT += multimedia

CONFIG += sailfishapp c++11

# Help, something keeps eating my quotes and backslashes
DEFINES += "SAILFIN_VERSION=\"\\\"0.1.0\\\"\""

SOURCES += \
src/credentialmanager.cpp \
src/harbour-sailfin.cpp \
Expand Down
12 changes: 3 additions & 9 deletions src/jellyfinapiclient.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#include "jellyfinapiclient.h"

#define STR2(x) #x
#define STR(x) STR2(x)

namespace Jellyfin {
ApiClient::ApiClient(QObject *parent)
: QObject(parent) {
Expand All @@ -21,18 +18,18 @@ ApiClient::ApiClient(QObject *parent)
void ApiClient::addBaseRequestHeaders(QNetworkRequest &request, const QString &path, const QUrlQuery &params) {
addTokenHeader(request);
request.setRawHeader("Accept", "application/json;"); // profile=\"CamelCase\"");
request.setHeader(QNetworkRequest::UserAgentHeader, QString("Sailfin/%1").arg(STR(SAILFIN_VERSION)));
request.setHeader(QNetworkRequest::UserAgentHeader, QString("Sailfin/%1").arg(m_version));
QString url = this->m_baseUrl + path;
if (!params.isEmpty()) url += "?" + params.toString();
request.setUrl(url);
}

void ApiClient::addTokenHeader(QNetworkRequest &request) {
QString authentication = "MediaBrowser ";
QString authentication = "MediaBrowser ";
authentication += "Client=\"Sailfin\"";
authentication += ", Device=\"" + m_deviceName + "\"";
authentication += ", DeviceId=\"" + m_deviceId + "\"";
authentication += ", Version=\"" + QString(STR(SAILFIN_VERSION)) + "\"";
authentication += ", Version=\"" + QString(m_version) + "\"";
if (m_authenticated) {
authentication += ", token=\"" + m_token + "\"";
}
Expand Down Expand Up @@ -254,6 +251,3 @@ void ApiClient::defaultNetworkErrorHandler(QNetworkReply::NetworkError error) {
rep->deleteLater();
}
}

#undef STR
#undef STR2
1 change: 1 addition & 0 deletions src/jellyfinapiclient.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ protected slots:

private:
QNetworkAccessManager m_naManager;
const char *m_version = SAILFIN_VERSION;
/*
* State information
*/
Expand Down

0 comments on commit edb514b

Please sign in to comment.