| | 1 | | #pragma warning disable CS1591 |
| | 2 | |
|
| | 3 | | using System.Linq; |
| | 4 | | using MediaBrowser.Controller.Configuration; |
| | 5 | | using MediaBrowser.Controller.Entities; |
| | 6 | | using MediaBrowser.Controller.Library; |
| | 7 | | using MediaBrowser.Controller.Providers; |
| | 8 | | using MediaBrowser.Model.Entities; |
| | 9 | | using MediaBrowser.Model.IO; |
| | 10 | | using MediaBrowser.Providers.Manager; |
| | 11 | | using Microsoft.Extensions.Logging; |
| | 12 | |
|
| | 13 | | namespace MediaBrowser.Providers.Movies |
| | 14 | | { |
| | 15 | | public class TrailerMetadataService : MetadataService<Trailer, TrailerInfo> |
| | 16 | | { |
| | 17 | | public TrailerMetadataService( |
| | 18 | | IServerConfigurationManager serverConfigurationManager, |
| | 19 | | ILogger<TrailerMetadataService> logger, |
| | 20 | | IProviderManager providerManager, |
| | 21 | | IFileSystem fileSystem, |
| | 22 | | ILibraryManager libraryManager) |
| 21 | 23 | | : base(serverConfigurationManager, logger, providerManager, fileSystem, libraryManager) |
| | 24 | | { |
| 21 | 25 | | } |
| | 26 | |
|
| | 27 | | /// <inheritdoc /> |
| | 28 | | protected override void MergeData(MetadataResult<Trailer> source, MetadataResult<Trailer> target, MetadataField[ |
| | 29 | | { |
| 0 | 30 | | base.MergeData(source, target, lockedFields, replaceData, mergeMetadataSettings); |
| | 31 | |
|
| 0 | 32 | | if (replaceData || target.Item.TrailerTypes.Length == 0) |
| | 33 | | { |
| 0 | 34 | | target.Item.TrailerTypes = source.Item.TrailerTypes; |
| | 35 | | } |
| | 36 | | else |
| | 37 | | { |
| 0 | 38 | | target.Item.TrailerTypes = target.Item.TrailerTypes.Concat(source.Item.TrailerTypes).Distinct().ToArray( |
| | 39 | | } |
| 0 | 40 | | } |
| | 41 | | } |
| | 42 | | } |