diff --git a/Jellyfin.Data/Enums/ChromecastVersion.cs b/Jellyfin.Data/Enums/ChromecastVersion.cs index 855c75ab45..2622e08efb 100644 --- a/Jellyfin.Data/Enums/ChromecastVersion.cs +++ b/Jellyfin.Data/Enums/ChromecastVersion.cs @@ -11,8 +11,8 @@ Stable = 0, /// - /// Nightly Chromecast version. + /// Unstable Chromecast version. /// - Nightly = 1 + Unstable = 1 } } diff --git a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs index 780c1488dd..b15ccf01eb 100644 --- a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs +++ b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Globalization; using System.IO; using System.Linq; @@ -64,6 +65,13 @@ namespace Jellyfin.Server.Migrations.Routines HomeSectionType.None, }; + var chromecastDict = new Dictionary(StringComparer.OrdinalIgnoreCase) + { + { "stable", ChromecastVersion.Stable }, + { "nightly", ChromecastVersion.Unstable }, + { "unstable", ChromecastVersion.Unstable } + }; + var dbFilePath = Path.Combine(_paths.DataPath, DbFilename); using (var connection = SQLite3.Open(dbFilePath, ConnectionFlags.ReadOnly, null)) { @@ -74,9 +82,7 @@ namespace Jellyfin.Server.Migrations.Routines { var dto = JsonSerializer.Deserialize(result[3].ToString(), _jsonOptions); var chromecastVersion = dto.CustomPrefs.TryGetValue("chromecastVersion", out var version) - ? Enum.TryParse(version, true, out var parsed) - ? parsed - : ChromecastVersion.Stable + ? chromecastDict[version] : ChromecastVersion.Stable; var displayPreferences = new DisplayPreferences(new Guid(result[1].ToBlob()), result[2].ToString())