mirror of
https://github.com/clangen/musikcube.git
synced 2025-01-05 21:55:24 +00:00
Added the ability to ignore client/server version mismatches for TUI remote libraries.
This commit is contained in:
parent
b65bc626c8
commit
dff519ee87
@ -133,8 +133,13 @@ WebSocketClient::WebSocketClient(IMessageQueue* messageQueue, Listener* listener
|
||||
auto messageId = responseJson["id"].get<std::string>();
|
||||
if (name == "authenticate") {
|
||||
this->connection = connection;
|
||||
|
||||
auto prefs = Preferences::ForComponent(core::prefs::components::Settings);
|
||||
auto ignoreVersionMismatch = prefs->GetInt(
|
||||
core::prefs::keys::RemoteLibraryIgnoreVersionMismatch, false);
|
||||
|
||||
auto appVersion = responseJson["options"]["environment"]["app_version"];
|
||||
if (!appVersion.is_string() || appVersion.get<std::string>() != VERSION) {
|
||||
if (!ignoreVersionMismatch && (!appVersion.is_string() || appVersion.get<std::string>() != VERSION)) {
|
||||
this->SetDisconnected(ConnectionError::IncompatibleVersion);
|
||||
}
|
||||
else {
|
||||
|
@ -79,6 +79,7 @@ namespace musik { namespace core { namespace prefs {
|
||||
const std::string keys::RemoteLibraryTranscoderEnabled = "RemoteLibraryTranscoderEnabled";
|
||||
const std::string keys::RemoteLibraryTranscoderFormat = "RemoteLibraryTranscoderFormat";
|
||||
const std::string keys::RemoteLibraryTranscoderBitrate = "RemoteLibraryTranscoderBitrate";
|
||||
const std::string keys::RemoteLibraryIgnoreVersionMismatch = "RemoteLibraryIgnoreVersionMismatch";
|
||||
const std::string keys::AsyncTrackListQueries = "AsyncTrackListQueries";
|
||||
|
||||
} } }
|
||||
|
@ -83,6 +83,7 @@ namespace musik { namespace core { namespace prefs {
|
||||
extern const std::string RemoteLibraryTranscoderEnabled;
|
||||
extern const std::string RemoteLibraryTranscoderFormat;
|
||||
extern const std::string RemoteLibraryTranscoderBitrate;
|
||||
extern const std::string RemoteLibraryIgnoreVersionMismatch;
|
||||
extern const std::string AsyncTrackListQueries;
|
||||
}
|
||||
|
||||
|
@ -119,6 +119,7 @@ static inline std::shared_ptr<ISchema> AdvancedSettingsSchema() {
|
||||
#endif
|
||||
schema->AddBool(cube::prefs::keys::AutoHideCommandBar, false);
|
||||
schema->AddInt(core::prefs::keys::RemoteLibraryLatencyTimeoutMs, 5000);
|
||||
schema->AddBool(core::prefs::keys::RemoteLibraryIgnoreVersionMismatch, false);
|
||||
schema->AddInt(core::prefs::keys::PlaybackTrackQueryTimeoutMs, 5000);
|
||||
schema->AddBool(core::prefs::keys::AsyncTrackListQueries, true);
|
||||
schema->AddBool(cube::prefs::keys::DisableRatingColumn, false);
|
||||
|
Loading…
Reference in New Issue
Block a user