diff options
| author | crobibero <cody@robibe.ro> | 2020-12-04 16:27:31 -0700 |
|---|---|---|
| committer | crobibero <cody@robibe.ro> | 2020-12-04 16:27:31 -0700 |
| commit | 76250a88959fa54646b45bbbb412dfeda30d556d (patch) | |
| tree | 65b2168c39f8fc9fccf4b5a5d9e1c8c7f3bed7d7 /Jellyfin.Api/Controllers/DisplayPreferencesController.cs | |
| parent | 3db6ae91f6aa68a1eaf3da3d385b069bdd7721ee (diff) | |
Use md5 Guid for legacy compat
Diffstat (limited to 'Jellyfin.Api/Controllers/DisplayPreferencesController.cs')
| -rw-r--r-- | Jellyfin.Api/Controllers/DisplayPreferencesController.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs index 7e67dfe94..8b8f63015 100644 --- a/Jellyfin.Api/Controllers/DisplayPreferencesController.cs +++ b/Jellyfin.Api/Controllers/DisplayPreferencesController.cs @@ -6,6 +6,7 @@ using System.Linq; using Jellyfin.Api.Constants; using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; +using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; using MediaBrowser.Model.Entities; using Microsoft.AspNetCore.Authorization; @@ -47,7 +48,11 @@ namespace Jellyfin.Api.Controllers [FromQuery, Required] Guid userId, [FromQuery, Required] string client) { - _ = Guid.TryParse(displayPreferencesId, out var itemId); + if (!Guid.TryParse(displayPreferencesId, out var itemId)) + { + itemId = displayPreferencesId.GetMD5(); + } + var displayPreferences = _displayPreferencesManager.GetDisplayPreferences(userId, itemId, client); var itemPreferences = _displayPreferencesManager.GetItemDisplayPreferences(displayPreferences.UserId, itemId, displayPreferences.Client); itemPreferences.ItemId = itemId; @@ -127,7 +132,11 @@ namespace Jellyfin.Api.Controllers HomeSectionType.LatestMedia, HomeSectionType.None, }; - _ = Guid.TryParse(displayPreferencesId, out var itemId); + if (!Guid.TryParse(displayPreferencesId, out var itemId)) + { + itemId = displayPreferencesId.GetMD5(); + } + var existingDisplayPreferences = _displayPreferencesManager.GetDisplayPreferences(userId, itemId, client); existingDisplayPreferences.IndexBy = Enum.TryParse<IndexingKind>(displayPreferences.IndexBy, true, out var indexBy) ? indexBy : (IndexingKind?)null; existingDisplayPreferences.ShowBackdrop = displayPreferences.ShowBackdrop; |
