aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller/Library/ItemController.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller/Library/ItemController.cs')
-rw-r--r--MediaBrowser.Controller/Library/ItemController.cs19
1 files changed, 5 insertions, 14 deletions
diff --git a/MediaBrowser.Controller/Library/ItemController.cs b/MediaBrowser.Controller/Library/ItemController.cs
index bc5cea79b..eb767d9a1 100644
--- a/MediaBrowser.Controller/Library/ItemController.cs
+++ b/MediaBrowser.Controller/Library/ItemController.cs
@@ -295,21 +295,12 @@ namespace MediaBrowser.Controller.Library
item.DateCreated = Directory.GetCreationTime(path);
item.DateModified = Directory.GetLastAccessTime(path);
- if (File.Exists(Path.Combine(path, "folder.jpg")))
- {
- item.PrimaryImagePath = Path.Combine(path, "folder.jpg");
- }
- else if (File.Exists(Path.Combine(path, "folder.png")))
- {
- item.PrimaryImagePath = Path.Combine(path, "folder.png");
- }
+ ItemResolveEventArgs args = new ItemResolveEventArgs();
+ args.Path = path;
+ args.FileAttributes = File.GetAttributes(path);
+ args.FileSystemChildren = Directory.GetFileSystemEntries(path, "*", SearchOption.TopDirectoryOnly).Select(f => new KeyValuePair<string, FileAttributes>(f, File.GetAttributes(f)));
- var b = false;
-
- if (b)
- {
- await Kernel.Instance.ExecuteMetadataProviders(item, null);
- }
+ await Kernel.Instance.ExecuteMetadataProviders(item, args);
return item;
}