diff options
| author | Luke <luke.pulverenti@gmail.com> | 2015-02-09 16:58:30 -0500 |
|---|---|---|
| committer | Luke <luke.pulverenti@gmail.com> | 2015-02-09 16:58:30 -0500 |
| commit | 4cc3b2f0ccd7c092a4acf72db4903415e175037a (patch) | |
| tree | f9f90f8665b726253b8b357674f2f141aa43abc9 /MediaBrowser.Controller/Entities/Person.cs | |
| parent | e7037a9b80843c127712f11430239f8fa3cb4aed (diff) | |
| parent | 3d7089a7dbabb652730c892206ca050f52f832b1 (diff) | |
Merge pull request #1005 from MediaBrowser/dev
3.0.5518.0
Diffstat (limited to 'MediaBrowser.Controller/Entities/Person.cs')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Person.cs | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/MediaBrowser.Controller/Entities/Person.cs b/MediaBrowser.Controller/Entities/Person.cs index fe8d61836..d8cb69ca1 100644 --- a/MediaBrowser.Controller/Entities/Person.cs +++ b/MediaBrowser.Controller/Entities/Person.cs @@ -1,4 +1,5 @@ -using MediaBrowser.Controller.Providers; +using System.Runtime.Serialization; +using MediaBrowser.Controller.Providers; using System; using System.Collections.Generic; using System.Linq; @@ -15,12 +16,12 @@ namespace MediaBrowser.Controller.Entities /// </summary> /// <value>The place of birth.</value> public string PlaceOfBirth { get; set; } - + /// <summary> /// Gets the user data key. /// </summary> /// <returns>System.String.</returns> - public override string GetUserDataKey() + protected override string CreateUserDataKey() { return "Person-" + Name; } @@ -35,6 +36,7 @@ namespace MediaBrowser.Controller.Entities /// If the item is a folder, it returns the folder itself /// </summary> /// <value>The containing folder path.</value> + [IgnoreDataMember] public override string ContainingFolderPath { get @@ -43,10 +45,16 @@ namespace MediaBrowser.Controller.Entities } } + public override bool CanDelete() + { + return false; + } + /// <summary> /// Gets a value indicating whether this instance is owned item. /// </summary> /// <value><c>true</c> if this instance is owned item; otherwise, <c>false</c>.</value> + [IgnoreDataMember] public override bool IsOwnedItem { get @@ -57,7 +65,13 @@ namespace MediaBrowser.Controller.Entities public IEnumerable<BaseItem> GetTaggedItems(IEnumerable<BaseItem> inputItems) { - return inputItems.Where(i => i.People.Any(p => string.Equals(p.Name, Name, StringComparison.OrdinalIgnoreCase))); + return inputItems.Where(GetItemFilter()); + } + + + public Func<BaseItem, bool> GetItemFilter() + { + return i => i.People.Any(p => string.Equals(p.Name, Name, StringComparison.OrdinalIgnoreCase)); } } |
