aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/IO/FileSystemHelper.cs
diff options
context:
space:
mode:
authorebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com>2012-09-19 10:22:53 -0400
committerebr11 Eric Reed spam <ebr11 Eric Reed spam@reedsplace.com>2012-09-19 10:22:53 -0400
commit6edc836ce591c466743a1d94a75cb3537c4835bd (patch)
treecc09e1b8beacddf200f49ffcc4b1cb7a9657afe8 /MediaBrowser.Controller/IO/FileSystemHelper.cs
parent442081f4e20a2a0bb5a17023817754ef6045b5ee (diff)
I lied - re-worked metadata folder handling again. Should now really only hit once and is available for other item types
Diffstat (limited to 'MediaBrowser.Controller/IO/FileSystemHelper.cs')
-rw-r--r--MediaBrowser.Controller/IO/FileSystemHelper.cs12
1 files changed, 12 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/IO/FileSystemHelper.cs b/MediaBrowser.Controller/IO/FileSystemHelper.cs
index 2897150a8..732cf0803 100644
--- a/MediaBrowser.Controller/IO/FileSystemHelper.cs
+++ b/MediaBrowser.Controller/IO/FileSystemHelper.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
+using System.IO;
using System.Threading.Tasks;
using MediaBrowser.Controller.Resolvers;
using MediaBrowser.Controller.Library;
@@ -67,6 +68,12 @@ namespace MediaBrowser.Controller.IO
args.IsBDFolder |= file.cFileName.Equals("bdmv", StringComparison.OrdinalIgnoreCase);
args.IsDVDFolder |= file.cFileName.Equals("video_ts", StringComparison.OrdinalIgnoreCase);
args.IsHDDVDFolder |= file.cFileName.Equals("hvdvd_ts", StringComparison.OrdinalIgnoreCase);
+
+ //and check to see if it is a metadata folder and collect contents now if so
+ if (IsMetadataFolder(file.cFileName))
+ {
+ args.MetadataFiles = Directory.GetFiles(Path.Combine(args.Path, "metadata"), "*", SearchOption.TopDirectoryOnly);
+ }
}
}
}
@@ -83,6 +90,11 @@ namespace MediaBrowser.Controller.IO
return args;
}
+ public static bool IsMetadataFolder(string path)
+ {
+ return path.TrimEnd('\\').EndsWith("metadata", StringComparison.OrdinalIgnoreCase);
+ }
+
public static bool IsVideoFile(string path)
{
string extension = System.IO.Path.GetExtension(path).ToLower();