From ae168bc56394057c42fa50a36e54e52617f84244 Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Thu, 2 Jun 2016 13:43:29 -0400 Subject: update tag saving --- MediaBrowser.Controller/Entities/TagExtensions.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 MediaBrowser.Controller/Entities/TagExtensions.cs (limited to 'MediaBrowser.Controller/Entities/TagExtensions.cs') 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); + } + } + } +} -- cgit v1.2.3