mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-07 14:52:52 +01:00
a few more async optimizations
This commit is contained in:
parent
1c5f728ec2
commit
fbf8cc833c
@@ -21,24 +21,23 @@ namespace MediaBrowser.Controller.Providers
|
||||
get { return MetadataProviderPriority.First; }
|
||||
}
|
||||
|
||||
public override Task Fetch(BaseEntity item, ItemResolveEventArgs args)
|
||||
public override Task FetchAsync(BaseEntity item, ItemResolveEventArgs args)
|
||||
{
|
||||
return Task.Run(() =>
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
if (args.IsDirectory)
|
||||
{
|
||||
var baseItem = item as BaseItem;
|
||||
var baseItem = item as BaseItem;
|
||||
|
||||
if (baseItem != null)
|
||||
{
|
||||
PopulateImages(baseItem, args);
|
||||
}
|
||||
else
|
||||
{
|
||||
PopulateImages(item, args);
|
||||
}
|
||||
if (baseItem != null)
|
||||
{
|
||||
return Task.Run(() => { PopulateImages(baseItem, args); });
|
||||
}
|
||||
});
|
||||
else
|
||||
{
|
||||
return Task.Run(() => { PopulateImages(item, args); });
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult<object>(null);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -49,7 +48,7 @@ namespace MediaBrowser.Controller.Providers
|
||||
for (int i = 0; i < args.FileSystemChildren.Length; i++)
|
||||
{
|
||||
var file = args.FileSystemChildren[i];
|
||||
|
||||
|
||||
string filePath = file.Path;
|
||||
|
||||
string ext = Path.GetExtension(filePath);
|
||||
|
||||
Reference in New Issue
Block a user