1
0
Fork 0
mirror of https://github.com/HenkKalkwater/harbour-sailfin.git synced 2024-05-02 20:52:43 +00:00

BUMP VERSION 0.1.0

This commit is contained in:
Chris Josten 2020-09-26 04:13:21 +02:00
parent 02f73fe11d
commit edb514bf2d
3 changed files with 7 additions and 9 deletions

View file

@ -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 \

View file

@ -1,8 +1,5 @@
#include "jellyfinapiclient.h"
#define STR2(x) #x
#define STR(x) STR2(x)
namespace Jellyfin {
ApiClient::ApiClient(QObject *parent)
: QObject(parent) {
@ -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 + "\"";
}
@ -254,6 +251,3 @@ void ApiClient::defaultNetworkErrorHandler(QNetworkReply::NetworkError error) {
rep->deleteLater();
}
}
#undef STR
#undef STR2

View file

@ -161,6 +161,7 @@ protected:
private:
QNetworkAccessManager m_naManager;
const char *m_version = SAILFIN_VERSION;
/*
* State information
*/