BookMetadataService.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using MediaBrowser.Common.IO;
  2. using MediaBrowser.Controller.Configuration;
  3. using MediaBrowser.Controller.Entities;
  4. using MediaBrowser.Controller.Library;
  5. using MediaBrowser.Controller.Providers;
  6. using MediaBrowser.Model.Entities;
  7. using MediaBrowser.Model.Logging;
  8. using MediaBrowser.Providers.Manager;
  9. using System.Collections.Generic;
  10. namespace MediaBrowser.Providers.Books
  11. {
  12. public class BookMetadataService : MetadataService<Book, BookInfo>
  13. {
  14. public BookMetadataService(IServerConfigurationManager serverConfigurationManager, ILogger logger, IProviderManager providerManager, IProviderRepository providerRepo, IFileSystem fileSystem, IUserDataManager userDataManager) : base(serverConfigurationManager, logger, providerManager, providerRepo, fileSystem, userDataManager)
  15. {
  16. }
  17. /// <summary>
  18. /// Merges the specified source.
  19. /// </summary>
  20. /// <param name="source">The source.</param>
  21. /// <param name="target">The target.</param>
  22. /// <param name="lockedFields">The locked fields.</param>
  23. /// <param name="replaceData">if set to <c>true</c> [replace data].</param>
  24. /// <param name="mergeMetadataSettings">if set to <c>true</c> [merge metadata settings].</param>
  25. protected override void MergeData(Book source, Book target, List<MetadataFields> lockedFields, bool replaceData, bool mergeMetadataSettings)
  26. {
  27. ProviderUtils.MergeBaseItemData(source, target, lockedFields, replaceData, mergeMetadataSettings);
  28. if (replaceData || string.IsNullOrEmpty(target.SeriesName))
  29. {
  30. target.SeriesName = source.SeriesName;
  31. }
  32. }
  33. }
  34. }