aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Entities/TagExtensions.cs
blob: 0e1df72cd0ef34a488b7e56949e2ac7cd6d6bf21 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);
            }
        }
    }
}