| | | 1 | | using System.Collections.Generic; |
| | | 2 | | using MediaBrowser.Controller.Configuration; |
| | | 3 | | using MediaBrowser.Controller.Entities; |
| | | 4 | | using MediaBrowser.Controller.Entities.Audio; |
| | | 5 | | using MediaBrowser.Controller.IO; |
| | | 6 | | using MediaBrowser.Controller.Library; |
| | | 7 | | using MediaBrowser.Controller.Persistence; |
| | | 8 | | using MediaBrowser.Controller.Providers; |
| | | 9 | | using MediaBrowser.Model.IO; |
| | | 10 | | using MediaBrowser.Providers.Manager; |
| | | 11 | | using Microsoft.Extensions.Logging; |
| | | 12 | | |
| | | 13 | | namespace MediaBrowser.Providers.Music; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// Service to manage artist metadata. |
| | | 17 | | /// </summary> |
| | | 18 | | public class ArtistMetadataService : MetadataService<MusicArtist, ArtistInfo> |
| | | 19 | | { |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the <see cref="ArtistMetadataService"/> class. |
| | | 22 | | /// </summary> |
| | | 23 | | /// <param name="serverConfigurationManager">Instance of the <see cref="IServerConfigurationManager"/>.</param> |
| | | 24 | | /// <param name="logger">Instance of the <see cref="ILogger"/> interface.</param> |
| | | 25 | | /// <param name="providerManager">Instance of the <see cref="IProviderManager"/> interface.</param> |
| | | 26 | | /// <param name="fileSystem">Instance of the <see cref="IFileSystem"/> interface.</param> |
| | | 27 | | /// <param name="libraryManager">Instance of the <see cref="ILibraryManager"/> interface.</param> |
| | | 28 | | /// <param name="externalDataManager">Instance of the <see cref="IExternalDataManager"/> interface.</param> |
| | | 29 | | /// <param name="itemRepository">Instance of the <see cref="IItemRepository"/> interface.</param> |
| | | 30 | | public ArtistMetadataService( |
| | | 31 | | IServerConfigurationManager serverConfigurationManager, |
| | | 32 | | ILogger<ArtistMetadataService> logger, |
| | | 33 | | IProviderManager providerManager, |
| | | 34 | | IFileSystem fileSystem, |
| | | 35 | | ILibraryManager libraryManager, |
| | | 36 | | IExternalDataManager externalDataManager, |
| | | 37 | | IItemRepository itemRepository) |
| | 21 | 38 | | : base(serverConfigurationManager, logger, providerManager, fileSystem, libraryManager, externalDataManager, ite |
| | | 39 | | { |
| | 21 | 40 | | } |
| | | 41 | | |
| | | 42 | | /// <inheritdoc /> |
| | 0 | 43 | | protected override bool EnableUpdatingGenresFromChildren => true; |
| | | 44 | | |
| | | 45 | | /// <inheritdoc /> |
| | | 46 | | protected override IReadOnlyList<BaseItem> GetChildrenForMetadataUpdates(MusicArtist item) |
| | | 47 | | { |
| | 0 | 48 | | return item.IsAccessedByName |
| | 0 | 49 | | ? item.GetTaggedItems(new InternalItemsQuery |
| | 0 | 50 | | { |
| | 0 | 51 | | Recursive = true, |
| | 0 | 52 | | IsFolder = false |
| | 0 | 53 | | }) |
| | 0 | 54 | | : item.GetRecursiveChildren(i => i is IHasArtist && !i.IsFolder); |
| | | 55 | | } |
| | | 56 | | } |