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