diff options
| author | Zach Phelan <ZachCPhelan@gmail.com> | 2022-09-13 17:13:02 -0600 |
|---|---|---|
| committer | Zach Phelan <ZachCPhelan@gmail.com> | 2022-09-13 17:13:02 -0600 |
| commit | 8857edb66cbc0260981aa1aa3542da495e1b2443 (patch) | |
| tree | fe2b0ec690db3ed63b2ff819f2c7963d4f9009ee | |
| parent | c71d6f2358ba8a5b1f80a2bef41b6f438c06d03c (diff) | |
Add function back for compatibility, add sorting
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 988d0a534..9461b01e3 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -2606,6 +2606,20 @@ namespace MediaBrowser.Controller.Entities .OrderBy(i => i.SortName); } + /// <summary> + /// Get all extras with specific types that are associated with this item. + /// </summary> + /// <param name="extraTypes">The types of extras to retrieve.</param> + /// <returns>An enumerable containing the extras.</returns> + public IEnumerable<BaseItem> GetExtras(IReadOnlyCollection<ExtraType> extraTypes) + { + return ExtraIds + .Select(LibraryManager.GetItemById) + .Where(i => i != null) + .Where(i => i.ExtraType.HasValue && extraTypes.Contains(i.ExtraType.Value)) + .OrderBy(i => i.SortName); + } + public virtual long GetRunTimeTicksForPlayState() { return RunTimeTicks ?? 0; |
