MovieMetadataService.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma warning disable CS1591
  2. using MediaBrowser.Controller.Configuration;
  3. using MediaBrowser.Controller.Entities.Movies;
  4. using MediaBrowser.Controller.Library;
  5. using MediaBrowser.Controller.Providers;
  6. using MediaBrowser.Model.Entities;
  7. using MediaBrowser.Model.IO;
  8. using MediaBrowser.Providers.Manager;
  9. using Microsoft.Extensions.Logging;
  10. namespace MediaBrowser.Providers.Movies
  11. {
  12. public class MovieMetadataService : MetadataService<Movie, MovieInfo>
  13. {
  14. public MovieMetadataService(
  15. IServerConfigurationManager serverConfigurationManager,
  16. ILogger<MovieMetadataService> logger,
  17. IProviderManager providerManager,
  18. IFileSystem fileSystem,
  19. ILibraryManager libraryManager)
  20. : base(serverConfigurationManager, logger, providerManager, fileSystem, libraryManager)
  21. {
  22. }
  23. /// <inheritdoc />
  24. protected override void MergeData(MetadataResult<Movie> source, MetadataResult<Movie> target, MetadataField[] lockedFields, bool replaceData, bool mergeMetadataSettings)
  25. {
  26. base.MergeData(source, target, lockedFields, replaceData, mergeMetadataSettings);
  27. var sourceItem = source.Item;
  28. var targetItem = target.Item;
  29. if (replaceData || string.IsNullOrEmpty(targetItem.CollectionName))
  30. {
  31. targetItem.CollectionName = sourceItem.CollectionName;
  32. }
  33. }
  34. }
  35. }