diff options
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/Library/LibraryManager.cs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 3ed682002..e2a2ce0a4 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -21,7 +21,6 @@ using MediaBrowser.Naming.Video; using MediaBrowser.Server.Implementations.Library.Resolvers.TV; using MediaBrowser.Server.Implementations.Library.Validators; using MediaBrowser.Server.Implementations.ScheduledTasks; -using MoreLinq; using System; using System.Collections.Concurrent; using System.Collections.Generic; @@ -1635,8 +1634,8 @@ namespace MediaBrowser.Server.Implementations.Library public bool IsVideoFile(string path) { - var parser = new VideoFileParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger()); - return parser.IsVideoFile(path); + var resolver = new VideoResolver(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger()); + return resolver.IsVideoFile(path); } public bool IsAudioFile(string path) @@ -1647,13 +1646,13 @@ namespace MediaBrowser.Server.Implementations.Library public bool IsMultiPartFile(string path) { - var parser = new MultiPartParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger()); + var parser = new MultiPartParser(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger()); return parser.Parse(path, FileInfoType.File).IsMultiPart; } public bool IsMultiPartFolder(string path) { - var parser = new MultiPartParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger()); + var parser = new MultiPartParser(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger()); return parser.Parse(path, FileInfoType.Directory).IsMultiPart; } @@ -1676,5 +1675,18 @@ namespace MediaBrowser.Server.Implementations.Library { return SeriesResolver.GetEpisodeNumberFromFile(path, considerSeasonless); } + + public ItemLookupInfo ParseName(string name) + { + var resolver = new VideoResolver(new ExpandedVideoOptions(), new AudioOptions(), new Naming.Logging.NullLogger()); + + var result = resolver.CleanDateTime(name); + + return new ItemLookupInfo + { + Name = result.Name, + Year = result.Year + }; + } } } |
