mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-28 04:55:11 +01:00
update storage of genres, studios, tags, & keywords
This commit is contained in:
21
MediaBrowser.Controller/Entities/KeywordExtensions.cs
Normal file
21
MediaBrowser.Controller/Entities/KeywordExtensions.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace MediaBrowser.Controller.Entities
|
||||
{
|
||||
public static class KeywordExtensions
|
||||
{
|
||||
public static void AddKeyword(this BaseItem item, string name)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(name))
|
||||
{
|
||||
throw new ArgumentNullException("name");
|
||||
}
|
||||
|
||||
if (!item.Keywords.Contains(name, StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
item.Keywords.Add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user