diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-02 13:43:29 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2016-06-02 13:43:29 -0400 |
| commit | ae168bc56394057c42fa50a36e54e52617f84244 (patch) | |
| tree | 644c9f56a5712493d8b7cfe2a75ea0a7a2c7844c /MediaBrowser.Controller/Entities/TagExtensions.cs | |
| parent | 85c508bcd1e09355b9881bdc243c511e81bc621c (diff) | |
update tag saving
Diffstat (limited to 'MediaBrowser.Controller/Entities/TagExtensions.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/TagExtensions.cs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/TagExtensions.cs b/MediaBrowser.Controller/Entities/TagExtensions.cs new file mode 100644 index 000000000..0e1df72cd --- /dev/null +++ b/MediaBrowser.Controller/Entities/TagExtensions.cs @@ -0,0 +1,21 @@ +using System; +using System.Linq; + +namespace MediaBrowser.Controller.Entities +{ + public static class TagExtensions + { + public static void AddTag(this BaseItem item, string name) + { + if (string.IsNullOrWhiteSpace(name)) + { + throw new ArgumentNullException("name"); + } + + if (!item.Tags.Contains(name, StringComparer.OrdinalIgnoreCase)) + { + item.Tags.Add(name); + } + } + } +} |
