Merge pull request #5873 from cvium/fix-displaypref-migration

This commit is contained in:
Bond-009 2021-04-20 15:51:57 +02:00 committed by GitHub
commit 233900401e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,13 +126,13 @@ namespace Jellyfin.Server.Migrations.Routines
ShowSidebar = dto.ShowSidebar, ShowSidebar = dto.ShowSidebar,
ScrollDirection = dto.ScrollDirection, ScrollDirection = dto.ScrollDirection,
ChromecastVersion = chromecastVersion, ChromecastVersion = chromecastVersion,
SkipForwardLength = dto.CustomPrefs.TryGetValue("skipForwardLength", out var length) SkipForwardLength = dto.CustomPrefs.TryGetValue("skipForwardLength", out var length) && int.TryParse(length, out var skipForwardLength)
? int.Parse(length, CultureInfo.InvariantCulture) ? skipForwardLength
: 30000, : 30000,
SkipBackwardLength = dto.CustomPrefs.TryGetValue("skipBackLength", out length) SkipBackwardLength = dto.CustomPrefs.TryGetValue("skipBackLength", out length) && !string.IsNullOrEmpty(length) && int.TryParse(length, out var skipBackwardLength)
? int.Parse(length, CultureInfo.InvariantCulture) ? skipBackwardLength
: 10000, : 10000,
EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled) EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled) && !string.IsNullOrEmpty(enabled)
? bool.Parse(enabled) ? bool.Parse(enabled)
: true, : true,
DashboardTheme = dto.CustomPrefs.TryGetValue("dashboardtheme", out var theme) ? theme : string.Empty, DashboardTheme = dto.CustomPrefs.TryGetValue("dashboardtheme", out var theme) ? theme : string.Empty,