diff options
| author | Shadowghost <Shadowghost@users.noreply.github.com> | 2024-06-01 18:40:55 -0400 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2024-06-01 18:40:55 -0400 |
| commit | c0364fc76696d759c761577a0b703426d0ca29ca (patch) | |
| tree | 259bfe9fc76cf973cf7f5e9d94cff855eee1ce12 /MediaBrowser.Controller | |
| parent | 76abff2fba81159449e030b2ec3ce52e834cf3f7 (diff) | |
Backport pull request #11719 from jellyfin/release-10.9.z
Move NFO series season name parsing to own local provider
Original-merge: a53ea029fade01a18e8e525543b5cda14e16533a
Merged-by: joshuaboniface <joshua@boniface.me>
Backported-by: Joshua M. Boniface <joshua@boniface.me>
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Series.cs | 23 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/ItemInfo.cs | 6 |
2 files changed, 6 insertions, 23 deletions
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs index d200721b28..e7a8a773ec 100644 --- a/MediaBrowser.Controller/Entities/TV/Series.cs +++ b/MediaBrowser.Controller/Entities/TV/Series.cs @@ -25,12 +25,9 @@ namespace MediaBrowser.Controller.Entities.TV /// </summary> public class Series : Folder, IHasTrailers, IHasDisplayOrder, IHasLookupInfo<SeriesInfo>, IMetadataContainer { - private readonly Dictionary<int, string> _seasonNames; - public Series() { AirDays = Array.Empty<DayOfWeek>(); - _seasonNames = new Dictionary<int, string>(); } public DayOfWeek[] AirDays { get; set; } @@ -212,26 +209,6 @@ namespace MediaBrowser.Controller.Entities.TV return LibraryManager.GetItemList(query); } - public Dictionary<int, string> GetSeasonNames() - { - var newSeasons = Children.OfType<Season>() - .Where(s => s.IndexNumber.HasValue) - .Where(s => !_seasonNames.ContainsKey(s.IndexNumber.Value)) - .DistinctBy(s => s.IndexNumber); - - foreach (var season in newSeasons) - { - SetSeasonName(season.IndexNumber.Value, season.Name); - } - - return _seasonNames; - } - - public void SetSeasonName(int index, string name) - { - _seasonNames[index] = name; - } - private void SetSeasonQueryOptions(InternalItemsQuery query, User user) { var seriesKey = GetUniqueSeriesKey(this); diff --git a/MediaBrowser.Controller/Providers/ItemInfo.cs b/MediaBrowser.Controller/Providers/ItemInfo.cs index 3a97127eaa..be3b25aee0 100644 --- a/MediaBrowser.Controller/Providers/ItemInfo.cs +++ b/MediaBrowser.Controller/Providers/ItemInfo.cs @@ -11,6 +11,8 @@ namespace MediaBrowser.Controller.Providers public ItemInfo(BaseItem item) { Path = item.Path; + ParentId = item.ParentId; + IndexNumber = item.IndexNumber; ContainingFolderPath = item.ContainingFolderPath; IsInMixedFolder = item.IsInMixedFolder; @@ -27,6 +29,10 @@ namespace MediaBrowser.Controller.Providers public string Path { get; set; } + public Guid ParentId { get; set; } + + public int? IndexNumber { get; set; } + public string ContainingFolderPath { get; set; } public VideoType VideoType { get; set; } |
