diff options
| author | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
|---|---|---|
| committer | JPVenson <github@jpb.email> | 2025-03-25 15:12:48 +0000 |
| commit | 850f1c79f1319de56a300c1d62565c9b2793b7d8 (patch) | |
| tree | f307a380c63d80809fed23c7ce2c8a0d0aba5de8 /MediaBrowser.Controller | |
| parent | ef7f6fc8a97118df7f410a7afa2f501f3f4ca3e2 (diff) | |
| parent | 671d801d9f734665d0acbd441246712ad2e3d91f (diff) | |
Merge branch 'master' into feature/DatabaseRefactor
Diffstat (limited to 'MediaBrowser.Controller')
| -rw-r--r-- | MediaBrowser.Controller/Entities/Audio/MusicArtist.cs | 6 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/BaseItem.cs | 5 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/PeopleHelper.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Entities/TV/Season.cs | 2 | ||||
| -rw-r--r-- | MediaBrowser.Controller/IO/IPathManager.cs | 17 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Library/ILibraryManager.cs | 12 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Persistence/IItemRepository.cs | 8 | ||||
| -rw-r--r-- | MediaBrowser.Controller/Providers/IExternalId.cs | 6 |
8 files changed, 43 insertions, 15 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs index 0985cdacb..e99479ee1 100644 --- a/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs +++ b/MediaBrowser.Controller/Entities/Audio/MusicArtist.cs @@ -139,11 +139,9 @@ namespace MediaBrowser.Controller.Entities.Audio private static List<string> GetUserDataKeys(MusicArtist item) { var list = new List<string>(); - var id = item.GetProviderId(MetadataProvider.MusicBrainzArtist); - - if (!string.IsNullOrEmpty(id)) + if (item.TryGetProviderId(MetadataProvider.MusicBrainzArtist, out var externalId)) { - list.Add("Artist-Musicbrainz-" + id); + list.Add("Artist-Musicbrainz-" + externalId); } list.Add("Artist-" + (item.Name ?? string.Empty).RemoveDiacritics()); diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index f8872e51f..e20679084 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -920,7 +920,7 @@ namespace MediaBrowser.Controller.Entities // Remove from middle if surrounded by spaces sortable = sortable.Replace(" " + search + " ", " ", StringComparison.Ordinal); - // Remove from end if followed by a space + // Remove from end if preceeded by a space if (sortable.EndsWith(" " + search, StringComparison.Ordinal)) { sortable = sortable.Remove(sortable.Length - (search.Length + 1)); @@ -1776,7 +1776,6 @@ namespace MediaBrowser.Controller.Entities public void AddStudio(string name) { ArgumentException.ThrowIfNullOrEmpty(name); - var current = Studios; if (!current.Contains(name, StringComparison.OrdinalIgnoreCase)) @@ -1795,7 +1794,7 @@ namespace MediaBrowser.Controller.Entities public void SetStudios(IEnumerable<string> names) { - Studios = names.Distinct().ToArray(); + Studios = names.Trimmed().Distinct().ToArray(); } /// <summary> diff --git a/MediaBrowser.Controller/Entities/PeopleHelper.cs b/MediaBrowser.Controller/Entities/PeopleHelper.cs index 4141b1712..24b1843ce 100644 --- a/MediaBrowser.Controller/Entities/PeopleHelper.cs +++ b/MediaBrowser.Controller/Entities/PeopleHelper.cs @@ -15,6 +15,8 @@ namespace MediaBrowser.Controller.Entities ArgumentNullException.ThrowIfNull(person); ArgumentException.ThrowIfNullOrEmpty(person.Name); + person.Name = person.Name.Trim(); + // Normalize if (string.Equals(person.Role, PersonType.GuestStar, StringComparison.OrdinalIgnoreCase)) { diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs index e3fbe8e4d..9dbac1e92 100644 --- a/MediaBrowser.Controller/Entities/TV/Season.cs +++ b/MediaBrowser.Controller/Entities/TV/Season.cs @@ -257,7 +257,7 @@ namespace MediaBrowser.Controller.Entities.TV if (!IndexNumber.HasValue && !string.IsNullOrEmpty(Path)) { - IndexNumber ??= LibraryManager.GetSeasonNumberFromPath(Path); + IndexNumber ??= LibraryManager.GetSeasonNumberFromPath(Path, ParentId); // If a change was made record it if (IndexNumber.HasValue) diff --git a/MediaBrowser.Controller/IO/IPathManager.cs b/MediaBrowser.Controller/IO/IPathManager.cs new file mode 100644 index 000000000..036889810 --- /dev/null +++ b/MediaBrowser.Controller/IO/IPathManager.cs @@ -0,0 +1,17 @@ +using MediaBrowser.Controller.Entities; + +namespace MediaBrowser.Controller.IO; + +/// <summary> +/// Interface ITrickplayManager. +/// </summary> +public interface IPathManager +{ + /// <summary> + /// Gets the path to the trickplay image base folder. + /// </summary> + /// <param name="item">The item.</param> + /// <param name="saveWithMedia">Whether or not the tile should be saved next to the media file.</param> + /// <returns>The absolute path.</returns> + public string GetTrickplayDirectory(BaseItem item, bool saveWithMedia = false); +} diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs index 47b1cb16e..e4490bca3 100644 --- a/MediaBrowser.Controller/Library/ILibraryManager.cs +++ b/MediaBrowser.Controller/Library/ILibraryManager.cs @@ -426,8 +426,9 @@ namespace MediaBrowser.Controller.Library /// Gets the season number from path. /// </summary> /// <param name="path">The path.</param> + /// <param name="parentId">The parent id.</param> /// <returns>System.Nullable<System.Int32>.</returns> - int? GetSeasonNumberFromPath(string path); + int? GetSeasonNumberFromPath(string path, Guid? parentId); /// <summary> /// Fills the missing episode numbers from path. @@ -566,6 +567,15 @@ namespace MediaBrowser.Controller.Library IReadOnlyList<BaseItem> GetItemList(InternalItemsQuery query, List<BaseItem> parents); /// <summary> + /// Gets the list of series presentation keys for next up. + /// </summary> + /// <param name="query">The query to use.</param> + /// <param name="parents">Items to use for query.</param> + /// <param name="dateCutoff">The minimum date for a series to have been most recently watched.</param> + /// <returns>List of series presentation keys.</returns> + IReadOnlyList<string> GetNextUpSeriesKeys(InternalItemsQuery query, IReadOnlyCollection<BaseItem> parents, DateTime dateCutoff); + + /// <summary> /// Gets the items result. /// </summary> /// <param name="query">The query.</param> diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs index afe2d833d..f1ed4fe27 100644 --- a/MediaBrowser.Controller/Persistence/IItemRepository.cs +++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs @@ -60,6 +60,14 @@ public interface IItemRepository IReadOnlyList<BaseItem> GetItemList(InternalItemsQuery filter); /// <summary> + /// Gets the list of series presentation keys for next up. + /// </summary> + /// <param name="filter">The query.</param> + /// <param name="dateCutoff">The minimum date for a series to have been most recently watched.</param> + /// <returns>The list of keys.</returns> + IReadOnlyList<string> GetNextUpSeriesKeys(InternalItemsQuery filter, DateTime dateCutoff); + + /// <summary> /// Updates the inherited values. /// </summary> void UpdateInheritedValues(); diff --git a/MediaBrowser.Controller/Providers/IExternalId.cs b/MediaBrowser.Controller/Providers/IExternalId.cs index f451eac6d..584c3297a 100644 --- a/MediaBrowser.Controller/Providers/IExternalId.cs +++ b/MediaBrowser.Controller/Providers/IExternalId.cs @@ -32,12 +32,6 @@ namespace MediaBrowser.Controller.Providers ExternalIdMediaType? Type { get; } /// <summary> - /// Gets the URL format string for this id. - /// </summary> - [Obsolete("Obsolete in 10.10, to be removed in 10.11")] - string? UrlFormatString { get; } - - /// <summary> /// Determines whether this id supports a given item type. /// </summary> /// <param name="item">The item.</param> |
