aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Barron <barronpm@gmail.com>2020-07-27 20:50:58 -0400
committerPatrick Barron <barronpm@gmail.com>2020-07-27 20:50:58 -0400
commit754837f16fef1c56cc8ccb30b75a0e316a72906a (patch)
treefcb8da3024364a6f54d9aa49a3b1ced8bb2502fb
parent7d6c1befe51ec20c4727426ae7bff8bb316e3495 (diff)
Add tv home.
-rw-r--r--Jellyfin.Data/Entities/DisplayPreferences.cs8
-rw-r--r--Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs4
-rw-r--r--MediaBrowser.Api/DisplayPreferencesService.cs2
3 files changed, 13 insertions, 1 deletions
diff --git a/Jellyfin.Data/Entities/DisplayPreferences.cs b/Jellyfin.Data/Entities/DisplayPreferences.cs
index d2cf99195..cda83f6bb 100644
--- a/Jellyfin.Data/Entities/DisplayPreferences.cs
+++ b/Jellyfin.Data/Entities/DisplayPreferences.cs
@@ -27,6 +27,7 @@ namespace Jellyfin.Data.Entities
ScrollDirection = ScrollDirection.Horizontal;
ChromecastVersion = ChromecastVersion.Stable;
DashboardTheme = string.Empty;
+ TvHome = string.Empty;
HomeSections = new HashSet<HomeSection>();
}
@@ -135,6 +136,13 @@ namespace Jellyfin.Data.Entities
public string DashboardTheme { get; set; }
/// <summary>
+ /// Gets or sets the tv home screen.
+ /// </summary>
+ [MaxLength(32)]
+ [StringLength(32)]
+ public string TvHome { get; set; }
+
+ /// <summary>
/// Gets or sets the home sections.
/// </summary>
public virtual ICollection<HomeSection> HomeSections { get; protected set; }
diff --git a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs
index 6a78bff4f..cef2c7435 100644
--- a/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs
+++ b/Jellyfin.Server/Migrations/Routines/MigrateDisplayPreferencesDb.cs
@@ -94,7 +94,9 @@ namespace Jellyfin.Server.Migrations.Routines
: 10000,
EnableNextVideoInfoOverlay = dto.CustomPrefs.TryGetValue("enableNextVideoInfoOverlay", out var enabled)
? bool.Parse(enabled)
- : true
+ : true,
+ DashboardTheme = dto.CustomPrefs.TryGetValue("dashboardtheme", out var theme) ? theme : string.Empty,
+ TvHome = dto.CustomPrefs.TryGetValue("tvhome", out var home) ? home : string.Empty
};
for (int i = 0; i < 7; i++)
diff --git a/MediaBrowser.Api/DisplayPreferencesService.cs b/MediaBrowser.Api/DisplayPreferencesService.cs
index 2cc7db624..4951dcc22 100644
--- a/MediaBrowser.Api/DisplayPreferencesService.cs
+++ b/MediaBrowser.Api/DisplayPreferencesService.cs
@@ -108,6 +108,7 @@ namespace MediaBrowser.Api
dto.CustomPrefs["skipForwardLength"] = displayPreferences.SkipForwardLength.ToString();
dto.CustomPrefs["skipBackLength"] = displayPreferences.SkipBackwardLength.ToString();
dto.CustomPrefs["enableNextVideoInfoOverlay"] = displayPreferences.EnableNextVideoInfoOverlay.ToString();
+ dto.CustomPrefs["tvhome"] = displayPreferences.TvHome;
return ToOptimizedResult(dto);
}
@@ -145,6 +146,7 @@ namespace MediaBrowser.Api
prefs.SkipBackwardLength = request.CustomPrefs.TryGetValue("skipBackLength", out var skipBackLength) ? int.Parse(skipBackLength) : 10000;
prefs.SkipForwardLength = request.CustomPrefs.TryGetValue("skipForwardLength", out var skipForwardLength) ? int.Parse(skipForwardLength) : 30000;
prefs.DashboardTheme = request.CustomPrefs.TryGetValue("dashboardTheme", out var theme) ? theme : string.Empty;
+ prefs.TvHome = request.CustomPrefs.TryGetValue("tvhome", out var home) ? home : string.Empty;
prefs.HomeSections.Clear();
foreach (var key in request.CustomPrefs.Keys.Where(key => key.StartsWith("homesection")))