Fixed a file system issue and also added a few more performance tweaks

This commit is contained in:
LukePulverenti Luke Pulverenti luke pulverenti
2012-08-20 21:51:00 -04:00
parent 906ad3cb1a
commit e6a95defc9
11 changed files with 64 additions and 64 deletions

View File

@@ -2,11 +2,9 @@
using System.Collections.Generic;
using System.ComponentModel.Composition;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
using MediaBrowser.Controller.Events;
using MediaBrowser.Model.Entities;
using MediaBrowser.Controller.IO;
namespace MediaBrowser.Controller.Providers
{
@@ -48,8 +46,10 @@ namespace MediaBrowser.Controller.Providers
/// </summary>
private void PopulateImages(BaseEntity item, ItemResolveEventArgs args)
{
foreach (KeyValuePair<string, WIN32_FIND_DATA> file in args.FileSystemChildren)
for (int i = 0; i < args.FileSystemChildren.Length; i++)
{
var file = args.FileSystemChildren[i];
if (file.Value.IsDirectory)
{
continue;
@@ -81,8 +81,10 @@ namespace MediaBrowser.Controller.Providers
{
List<string> backdropFiles = new List<string>();
foreach (KeyValuePair<string, WIN32_FIND_DATA> file in args.FileSystemChildren)
for (int i = 0; i < args.FileSystemChildren.Length; i++)
{
var file = args.FileSystemChildren[i];
if (file.Value.IsDirectory)
{
continue;
@@ -126,7 +128,7 @@ namespace MediaBrowser.Controller.Providers
}
}
if (backdropFiles.Any())
if (backdropFiles.Count > 0)
{
item.BackdropImagePaths = backdropFiles;
}

View File

@@ -32,8 +32,10 @@ namespace MediaBrowser.Controller.Providers
List<Video> localTrailers = new List<Video>();
foreach (string file in allFiles)
for (int i = 0; i < allFiles.Length; i++)
{
string file = allFiles[i];
BaseItem child = await Kernel.Instance.ItemController.GetItem(file).ConfigureAwait(false);
Video video = child as Video;