aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Library
diff options
context:
space:
mode:
authorz0rimo <46391780+z0rimo@users.noreply.github.com>2026-10-05 19:18:51 -0400
committerCody Robibero <cody@robibe.ro>2026-10-05 19:18:51 -0400
commitd624b7c57ae586dcaba61b45b6695031ebfba371 (patch)
treeef670430474a912b3ecb3f0011138a50870c974f /Emby.Server.Implementations/Library
parent8c7878afaac773e4622bf19dcd51c5761840791c (diff)
Backport pull request #18236 from jellyfin/release-12.z
Fix user preferences when renaming libraries Original-merge: 9203258175c32b44052d2a0fc5bae9815697c80b Merged-by: crobibero <cody@robibe.ro> Backported-by: Cody Robibero <cody@robibe.ro>
Diffstat (limited to 'Emby.Server.Implementations/Library')
-rw-r--r--Emby.Server.Implementations/Library/LibraryManager.cs33
1 files changed, 21 insertions, 12 deletions
diff --git a/Emby.Server.Implementations/Library/LibraryManager.cs b/Emby.Server.Implementations/Library/LibraryManager.cs
index 2d62fdab48..b4f6f57bf6 100644
--- a/Emby.Server.Implementations/Library/LibraryManager.cs
+++ b/Emby.Server.Implementations/Library/LibraryManager.cs
@@ -3052,14 +3052,7 @@ namespace Emby.Server.Implementations.Library
CollectionType? viewType,
string sortName)
{
- var parentIdString = parentId.IsEmpty()
- ? null
- : parentId.ToString("N", CultureInfo.InvariantCulture);
-
- // The name is either localized (grouped views) or the library folder's own name.
- var idValues = "38_namedview_" + user.Id.ToString("N", CultureInfo.InvariantCulture) + (parentIdString ?? string.Empty) + (viewType?.ToString() ?? string.Empty);
-
- var id = GetNewItemId(idValues, typeof(UserView));
+ var id = GetNamedViewId(user, parentId, viewType);
var path = Path.Combine(_configurationManager.ApplicationPaths.InternalMetadataPath, "views", id.ToString("N", CultureInfo.InvariantCulture));
@@ -3117,6 +3110,18 @@ namespace Emby.Server.Implementations.Library
return item;
}
+ public Guid GetNamedViewId(User user, Guid parentId, CollectionType? viewType)
+ {
+ var parentIdString = parentId.IsEmpty()
+ ? null
+ : parentId.ToString("N", CultureInfo.InvariantCulture);
+
+ // The name is either localized (grouped views) or the library folder's own name.
+ var idValues = "38_namedview_" + user.Id.ToString("N", CultureInfo.InvariantCulture) + (parentIdString ?? string.Empty) + (viewType?.ToString() ?? string.Empty);
+
+ return GetNewItemId(idValues, typeof(UserView));
+ }
+
public UserView GetShadowView(
BaseItem parent,
CollectionType? viewType,
@@ -3126,10 +3131,7 @@ namespace Emby.Server.Implementations.Library
var name = parent.Name;
var parentId = parent.Id;
-
- var idValues = "38_namedview_" + name + parentId + (viewType?.ToString() ?? string.Empty);
-
- var id = GetNewItemId(idValues, typeof(UserView));
+ var id = GetShadowViewId(name, parentId, viewType);
var path = parent.Path;
@@ -3181,6 +3183,13 @@ namespace Emby.Server.Implementations.Library
return item;
}
+ public Guid GetShadowViewId(string name, Guid parentId, CollectionType? viewType)
+ {
+ var idValues = "38_namedview_" + name + parentId + (viewType?.ToString() ?? string.Empty);
+
+ return GetNewItemId(idValues, typeof(UserView));
+ }
+
public UserView GetNamedView(
string name,
Guid parentId,