mirror of
https://github.com/HenkKalkwater/harbour-sailfin.git
synced 2024-11-22 09:15:18 +00:00
BUMP VERSION 0.1.0
This commit is contained in:
parent
02f73fe11d
commit
edb514bf2d
|
@ -16,6 +16,9 @@ QT += multimedia
|
||||||
|
|
||||||
CONFIG += sailfishapp c++11
|
CONFIG += sailfishapp c++11
|
||||||
|
|
||||||
|
# Help, something keeps eating my quotes and backslashes
|
||||||
|
DEFINES += "SAILFIN_VERSION=\"\\\"0.1.0\\\"\""
|
||||||
|
|
||||||
SOURCES += \
|
SOURCES += \
|
||||||
src/credentialmanager.cpp \
|
src/credentialmanager.cpp \
|
||||||
src/harbour-sailfin.cpp \
|
src/harbour-sailfin.cpp \
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
#include "jellyfinapiclient.h"
|
#include "jellyfinapiclient.h"
|
||||||
|
|
||||||
#define STR2(x) #x
|
|
||||||
#define STR(x) STR2(x)
|
|
||||||
|
|
||||||
namespace Jellyfin {
|
namespace Jellyfin {
|
||||||
ApiClient::ApiClient(QObject *parent)
|
ApiClient::ApiClient(QObject *parent)
|
||||||
: QObject(parent) {
|
: QObject(parent) {
|
||||||
|
@ -21,7 +18,7 @@ ApiClient::ApiClient(QObject *parent)
|
||||||
void ApiClient::addBaseRequestHeaders(QNetworkRequest &request, const QString &path, const QUrlQuery ¶ms) {
|
void ApiClient::addBaseRequestHeaders(QNetworkRequest &request, const QString &path, const QUrlQuery ¶ms) {
|
||||||
addTokenHeader(request);
|
addTokenHeader(request);
|
||||||
request.setRawHeader("Accept", "application/json;"); // profile=\"CamelCase\"");
|
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;
|
QString url = this->m_baseUrl + path;
|
||||||
if (!params.isEmpty()) url += "?" + params.toString();
|
if (!params.isEmpty()) url += "?" + params.toString();
|
||||||
request.setUrl(url);
|
request.setUrl(url);
|
||||||
|
@ -32,7 +29,7 @@ void ApiClient::addTokenHeader(QNetworkRequest &request) {
|
||||||
authentication += "Client=\"Sailfin\"";
|
authentication += "Client=\"Sailfin\"";
|
||||||
authentication += ", Device=\"" + m_deviceName + "\"";
|
authentication += ", Device=\"" + m_deviceName + "\"";
|
||||||
authentication += ", DeviceId=\"" + m_deviceId + "\"";
|
authentication += ", DeviceId=\"" + m_deviceId + "\"";
|
||||||
authentication += ", Version=\"" + QString(STR(SAILFIN_VERSION)) + "\"";
|
authentication += ", Version=\"" + QString(m_version) + "\"";
|
||||||
if (m_authenticated) {
|
if (m_authenticated) {
|
||||||
authentication += ", token=\"" + m_token + "\"";
|
authentication += ", token=\"" + m_token + "\"";
|
||||||
}
|
}
|
||||||
|
@ -254,6 +251,3 @@ void ApiClient::defaultNetworkErrorHandler(QNetworkReply::NetworkError error) {
|
||||||
rep->deleteLater();
|
rep->deleteLater();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef STR
|
|
||||||
#undef STR2
|
|
||||||
|
|
|
@ -161,6 +161,7 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QNetworkAccessManager m_naManager;
|
QNetworkAccessManager m_naManager;
|
||||||
|
const char *m_version = SAILFIN_VERSION;
|
||||||
/*
|
/*
|
||||||
* State information
|
* State information
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue