aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/Library/LibraryManager.cs')
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 9f8712384..3ed682002 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -15,6 +15,10 @@ using MediaBrowser.Controller.Sorting;
using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Naming.Audio;
+using MediaBrowser.Naming.IO;
+using MediaBrowser.Naming.Video;
+using MediaBrowser.Server.Implementations.Library.Resolvers.TV;
using MediaBrowser.Server.Implementations.Library.Validators;
using MediaBrowser.Server.Implementations.ScheduledTasks;
using MoreLinq;
@@ -1628,5 +1632,49 @@ namespace MediaBrowser.Server.Implementations.Library
return item;
}
+
+ public bool IsVideoFile(string path)
+ {
+ var parser = new VideoFileParser(new ExpandedVideoOptions(), new Naming.Logging.NullLogger());
+ return parser.IsVideoFile(path);
+ }
+
+ public bool IsAudioFile(string path)
+ {
+ var parser = new AudioFileParser(new AudioOptions());
+ return parser.IsAudioFile(path);
+ }
+
+ public bool IsMultiPartFile(string path)
+ {
+ var parser = new MultiPartParser(new ExpandedVideoOptions(), 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());
+ return parser.Parse(path, FileInfoType.Directory).IsMultiPart;
+ }
+
+ public int? GetSeasonNumberFromPath(string path)
+ {
+ return SeriesResolver.GetSeasonNumberFromPath(path);
+ }
+
+ public int? GetSeasonNumberFromEpisodeFile(string path)
+ {
+ return SeriesResolver.GetSeasonNumberFromEpisodeFile(path);
+ }
+
+ public int? GetEndingEpisodeNumberFromFile(string path)
+ {
+ return SeriesResolver.GetEndingEpisodeNumberFromFile(path);
+ }
+
+ public int? GetEpisodeNumberFromFile(string path, bool considerSeasonless)
+ {
+ return SeriesResolver.GetEpisodeNumberFromFile(path, considerSeasonless);
+ }
}
}