|
@@ -6,9 +6,6 @@
|
|
#include <QDesktopServices>
|
|
#include <QDesktopServices>
|
|
#include <QDir>
|
|
#include <QDir>
|
|
#include <QJsonObject>
|
|
#include <QJsonObject>
|
|
-#include <QNetworkRequest>
|
|
|
|
-#include <QNetworkAccessManager>
|
|
|
|
-#include <QNetworkReply>
|
|
|
|
|
|
|
|
#include "input/InputComponent.h"
|
|
#include "input/InputComponent.h"
|
|
#include "SystemComponent.h"
|
|
#include "SystemComponent.h"
|
|
@@ -334,37 +331,6 @@ QString SystemComponent::getNativeShellScript()
|
|
return nativeshellString;
|
|
return nativeshellString;
|
|
}
|
|
}
|
|
|
|
|
|
-/////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
-void SystemComponent::checkForUpdates()
|
|
|
|
-{
|
|
|
|
- if (SettingsComponent::Get().value(SETTINGS_SECTION_MAIN, "checkForUpdates").toBool()) {
|
|
|
|
-#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC)
|
|
|
|
- QNetworkAccessManager *manager = new QNetworkAccessManager(this);
|
|
|
|
- QString checkUrl = "https://github.com/jellyfin/jellyfin-media-player/releases/latest";
|
|
|
|
- QUrl qCheckUrl = QUrl(checkUrl);
|
|
|
|
- QLOG_DEBUG() << QString("Checking URL for updates: %1").arg(checkUrl);
|
|
|
|
- QNetworkRequest req(qCheckUrl);
|
|
|
|
-
|
|
|
|
- connect(manager, &QNetworkAccessManager::finished, this, &SystemComponent::updateInfoHandler);
|
|
|
|
- manager->get(req);
|
|
|
|
-#else
|
|
|
|
- emit updateInfoEmitted("SSL_UNAVAILABLE");
|
|
|
|
-#endif
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-/////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
-void SystemComponent::updateInfoHandler(QNetworkReply* reply)
|
|
|
|
-{
|
|
|
|
- if (reply->error() == QNetworkReply::NoError) {
|
|
|
|
- int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
|
|
|
|
- if(statusCode == 302) {
|
|
|
|
- QUrl redirectUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toUrl();
|
|
|
|
- emit updateInfoEmitted(redirectUrl.toString());
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
/////////////////////////////////////////////////////////////////////////////////////////
|
|
#define BASESTR "protocols=shoutcast,http-video;videoDecoders=h264{profile:high&resolution:2160&level:52};audioDecoders=mp3,aac,dts{bitrate:800000&channels:%1},ac3{bitrate:800000&channels:%2}"
|
|
#define BASESTR "protocols=shoutcast,http-video;videoDecoders=h264{profile:high&resolution:2160&level:52};audioDecoders=mp3,aac,dts{bitrate:800000&channels:%1},ac3{bitrate:800000&channels:%2}"
|
|
|
|
|