PersonMetadataService.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. using System.Threading;
  11. using System.Threading.Tasks;
  12. namespace MediaBrowser.Providers.People
  13. {
  14. public class PersonMetadataService : MetadataService<Person, PersonLookupInfo>
  15. {
  16. private readonly ILibraryManager _libraryManager;
  17. public PersonMetadataService(IServerConfigurationManager serverConfigurationManager, ILogger logger, IProviderManager providerManager, IProviderRepository providerRepo, IFileSystem fileSystem, ILibraryManager libraryManager)
  18. : base(serverConfigurationManager, logger, providerManager, providerRepo, fileSystem)
  19. {
  20. _libraryManager = libraryManager;
  21. }
  22. /// <summary>
  23. /// Merges the specified source.
  24. /// </summary>
  25. /// <param name="source">The source.</param>
  26. /// <param name="target">The target.</param>
  27. /// <param name="lockedFields">The locked fields.</param>
  28. /// <param name="replaceData">if set to <c>true</c> [replace data].</param>
  29. /// <param name="mergeMetadataSettings">if set to <c>true</c> [merge metadata settings].</param>
  30. protected override void MergeData(Person source, Person target, List<MetadataFields> lockedFields, bool replaceData, bool mergeMetadataSettings)
  31. {
  32. ProviderUtils.MergeBaseItemData(source, target, lockedFields, replaceData, mergeMetadataSettings);
  33. if (replaceData || string.IsNullOrEmpty(target.PlaceOfBirth))
  34. {
  35. target.PlaceOfBirth = source.PlaceOfBirth;
  36. }
  37. }
  38. }
  39. }