diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-09 18:14:44 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2014-03-09 18:14:44 -0400 |
| commit | d49494476770b3c0a091841bd3bbd44862fb8137 (patch) | |
| tree | f0bf4bffa8b4d8a91de9e9096941aa34082a8e91 /MediaBrowser.Controller/Entities/IItemByName.cs | |
| parent | 1ead63b0d1a532cf828a4ed7c5310eef9c255740 (diff) | |
calculate item by name counts on the fly
Diffstat (limited to 'MediaBrowser.Controller/Entities/IItemByName.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/IItemByName.cs | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/MediaBrowser.Controller/Entities/IItemByName.cs b/MediaBrowser.Controller/Entities/IItemByName.cs index 1e83c7466..70d5b840f 100644 --- a/MediaBrowser.Controller/Entities/IItemByName.cs +++ b/MediaBrowser.Controller/Entities/IItemByName.cs @@ -1,7 +1,4 @@ -using MediaBrowser.Model.Dto; -using System; -using System.Collections.Generic; -using System.Linq; +using System.Collections.Generic; namespace MediaBrowser.Controller.Entities { @@ -10,37 +7,16 @@ namespace MediaBrowser.Controller.Entities /// </summary> public interface IItemByName { - List<ItemByNameCounts> UserItemCountList { get; set; } + /// <summary> + /// Gets the tagged items. + /// </summary> + /// <param name="inputItems">The input items.</param> + /// <returns>IEnumerable{BaseItem}.</returns> + IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems); } public interface IHasDualAccess : IItemByName { bool IsAccessedByName { get; } } - - public static class ItemByNameExtensions - { - public static ItemByNameCounts GetItemByNameCounts(this IItemByName item, Guid userId) - { - if (userId == Guid.Empty) - { - throw new ArgumentNullException("userId"); - } - - return item.UserItemCountList.FirstOrDefault(i => i.UserId == userId); - } - - public static void SetItemByNameCounts(this IItemByName item, Guid userId, ItemByNameCounts counts) - { - var current = item.UserItemCountList.FirstOrDefault(i => i.UserId == userId); - - if (current != null) - { - item.UserItemCountList.Remove(current); - } - - counts.UserId = userId; - item.UserItemCountList.Add(counts); - } - } } |
