|
@@ -1,6 +1,7 @@
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Entities;
|
|
using MediaBrowser.Controller.Library;
|
|
using MediaBrowser.Controller.Library;
|
|
using MediaBrowser.Model.Entities;
|
|
using MediaBrowser.Model.Entities;
|
|
|
|
+using MediaBrowser.Controller.IO;
|
|
using System.ComponentModel.Composition;
|
|
using System.ComponentModel.Composition;
|
|
using System.IO;
|
|
using System.IO;
|
|
|
|
|
|
@@ -29,7 +30,7 @@ namespace MediaBrowser.Controller.Resolvers
|
|
// If the path is a file check for a matching extensions
|
|
// If the path is a file check for a matching extensions
|
|
if (!args.IsDirectory)
|
|
if (!args.IsDirectory)
|
|
{
|
|
{
|
|
- if (IsVideoFile(args.Path))
|
|
|
|
|
|
+ if (FileSystemHelper.IsVideoFile(args.Path))
|
|
{
|
|
{
|
|
VideoType type = Path.GetExtension(args.Path).EndsWith("iso", System.StringComparison.OrdinalIgnoreCase) ? VideoType.Iso : VideoType.VideoFile;
|
|
VideoType type = Path.GetExtension(args.Path).EndsWith("iso", System.StringComparison.OrdinalIgnoreCase) ? VideoType.Iso : VideoType.VideoFile;
|
|
|
|
|
|
@@ -95,38 +96,5 @@ namespace MediaBrowser.Controller.Resolvers
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
- private static bool IsVideoFile(string path)
|
|
|
|
- {
|
|
|
|
- string extension = Path.GetExtension(path).ToLower();
|
|
|
|
-
|
|
|
|
- switch (extension)
|
|
|
|
- {
|
|
|
|
- case ".mkv":
|
|
|
|
- case ".m2ts":
|
|
|
|
- case ".iso":
|
|
|
|
- case ".ts":
|
|
|
|
- case ".rmvb":
|
|
|
|
- case ".mov":
|
|
|
|
- case ".avi":
|
|
|
|
- case ".mpg":
|
|
|
|
- case ".mpeg":
|
|
|
|
- case ".wmv":
|
|
|
|
- case ".mp4":
|
|
|
|
- case ".divx":
|
|
|
|
- case ".dvr-ms":
|
|
|
|
- case ".wtv":
|
|
|
|
- case ".ogm":
|
|
|
|
- case ".ogv":
|
|
|
|
- case ".asf":
|
|
|
|
- case ".m4v":
|
|
|
|
- case ".flv":
|
|
|
|
- case ".f4v":
|
|
|
|
- case ".3gp":
|
|
|
|
- return true;
|
|
|
|
-
|
|
|
|
- default:
|
|
|
|
- return false;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|