aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortheguymadmax <theguymadmax@proton.me>2026-05-31 21:13:34 -0400
committertheguymadmax <theguymadmax@proton.me>2026-05-31 21:13:34 -0400
commit5ce7170813e7ffbe8ac119692c2fc1675deebca7 (patch)
tree1bbbf73fdc4c43f7c97db83912b87856aafc70a3
parent2a95223c6718bf8892369322b8a30a45e430739f (diff)
Trim tags
-rw-r--r--Jellyfin.Api/Controllers/ItemUpdateController.cs2
-rw-r--r--MediaBrowser.Controller/Entities/TagExtensions.cs1
2 files changed, 2 insertions, 1 deletions
diff --git a/Jellyfin.Api/Controllers/ItemUpdateController.cs b/Jellyfin.Api/Controllers/ItemUpdateController.cs
index 4d697ab854..d560ee8238 100644
--- a/Jellyfin.Api/Controllers/ItemUpdateController.cs
+++ b/Jellyfin.Api/Controllers/ItemUpdateController.cs
@@ -288,7 +288,7 @@ public class ItemUpdateController : BaseJellyfinApiController
item.CustomRating = request.CustomRating;
var currentTags = item.Tags;
- var newTags = request.Tags.Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
+ var newTags = request.Tags.Select(t => t.Trim()).Distinct(StringComparer.OrdinalIgnoreCase).ToArray();
var removedTags = currentTags.Except(newTags).ToList();
var addedTags = newTags.Except(currentTags).ToList();
item.Tags = newTags;
diff --git a/MediaBrowser.Controller/Entities/TagExtensions.cs b/MediaBrowser.Controller/Entities/TagExtensions.cs
index 4ddba9835b..07c2298fce 100644
--- a/MediaBrowser.Controller/Entities/TagExtensions.cs
+++ b/MediaBrowser.Controller/Entities/TagExtensions.cs
@@ -15,6 +15,7 @@ namespace MediaBrowser.Controller.Entities
throw new ArgumentNullException(nameof(name));
}
+ name = name.Trim();
var current = item.Tags;
if (!current.Contains(name, StringComparison.OrdinalIgnoreCase))