Added the ability to ignore client/server version mismatches for TUI remote libraries.

This commit is contained in:
casey langen 2020-12-05 13:36:12 -08:00
parent b65bc626c8
commit dff519ee87
4 changed files with 9 additions and 1 deletions

View File

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

View File

@ -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";
} } }

View File

@ -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;
}

View File

@ -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);