| | 1 | | using MediaBrowser.Controller.Configuration; |
| | 2 | | using MediaBrowser.Controller.Entities; |
| | 3 | | using MediaBrowser.Controller.IO; |
| | 4 | | using MediaBrowser.Controller.Library; |
| | 5 | | using MediaBrowser.Controller.Persistence; |
| | 6 | | using MediaBrowser.Controller.Providers; |
| | 7 | | using MediaBrowser.Model.Entities; |
| | 8 | | using MediaBrowser.Model.IO; |
| | 9 | | using MediaBrowser.Providers.Manager; |
| | 10 | | using Microsoft.Extensions.Logging; |
| | 11 | |
|
| | 12 | | namespace MediaBrowser.Providers.Books; |
| | 13 | |
|
| | 14 | | /// <summary> |
| | 15 | | /// Service to manage book metadata. |
| | 16 | | /// </summary> |
| | 17 | | public class BookMetadataService : MetadataService<Book, BookInfo> |
| | 18 | | { |
| | 19 | | /// <summary> |
| | 20 | | /// Initializes a new instance of the <see cref="BookMetadataService"/> 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 | | /// <param name="itemRepository">Instance of the <see cref="IItemRepository"/> interface.</param> |
| | 29 | | public BookMetadataService( |
| | 30 | | IServerConfigurationManager serverConfigurationManager, |
| | 31 | | ILogger<BookMetadataService> logger, |
| | 32 | | IProviderManager providerManager, |
| | 33 | | IFileSystem fileSystem, |
| | 34 | | ILibraryManager libraryManager, |
| | 35 | | IExternalDataManager externalDataManager, |
| | 36 | | IItemRepository itemRepository) |
| 21 | 37 | | : base(serverConfigurationManager, logger, providerManager, fileSystem, libraryManager, externalDataManager, ite |
| | 38 | | { |
| 21 | 39 | | } |
| | 40 | |
|
| | 41 | | /// <inheritdoc /> |
| | 42 | | protected override void MergeData(MetadataResult<Book> source, MetadataResult<Book> target, MetadataField[] lockedFi |
| | 43 | | { |
| 0 | 44 | | base.MergeData(source, target, lockedFields, replaceData, mergeMetadataSettings); |
| | 45 | |
|
| 0 | 46 | | if (replaceData || string.IsNullOrEmpty(target.Item.SeriesName)) |
| | 47 | | { |
| 0 | 48 | | target.Item.SeriesName = source.Item.SeriesName; |
| | 49 | | } |
| 0 | 50 | | } |
| | 51 | | } |