| | | 1 | | #nullable disable |
| | | 2 | | |
| | | 3 | | using Emby.Naming.Common; |
| | | 4 | | using MediaBrowser.Controller.Entities; |
| | | 5 | | using MediaBrowser.Controller.Library; |
| | | 6 | | using MediaBrowser.Controller.Providers; |
| | | 7 | | using Microsoft.Extensions.Logging; |
| | | 8 | | |
| | | 9 | | namespace Emby.Server.Implementations.Library.Resolvers |
| | | 10 | | { |
| | | 11 | | /// <summary> |
| | | 12 | | /// Resolves a Path into an instance of the <see cref="Video"/> class. |
| | | 13 | | /// </summary> |
| | | 14 | | /// <typeparam name="T">The type of item to resolve.</typeparam> |
| | | 15 | | public class GenericVideoResolver<T> : BaseVideoResolver<T> |
| | | 16 | | where T : Video, new() |
| | | 17 | | { |
| | | 18 | | private readonly bool _parseName; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Initializes a new instance of the <see cref="GenericVideoResolver{T}"/> class. |
| | | 22 | | /// </summary> |
| | | 23 | | /// <param name="logger">The logger.</param> |
| | | 24 | | /// <param name="namingOptions">The naming options.</param> |
| | | 25 | | /// <param name="directoryService">The directory service.</param> |
| | | 26 | | /// <param name="parseName">Whether to parse the file name for metadata such as the year.</param> |
| | | 27 | | public GenericVideoResolver(ILogger logger, NamingOptions namingOptions, IDirectoryService directoryService, boo |
| | 38 | 28 | | : base(logger, namingOptions, directoryService) |
| | | 29 | | { |
| | 38 | 30 | | _parseName = parseName; |
| | 38 | 31 | | } |
| | | 32 | | |
| | | 33 | | /// <inheritdoc /> |
| | | 34 | | protected override T Resolve(ItemResolveArgs args) |
| | | 35 | | { |
| | 22 | 36 | | return ResolveVideo<T>(args, _parseName); |
| | | 37 | | } |
| | | 38 | | } |
| | | 39 | | } |