Fix a few multiple enumerations

pull/10154/head
Stepan Goremykin 1 year ago
parent 3ee1141a06
commit 0ed2aa6f06

@ -358,7 +358,7 @@ namespace Emby.Server.Implementations.Library
var children = item.IsFolder var children = item.IsFolder
? ((Folder)item).GetRecursiveChildren(false) ? ((Folder)item).GetRecursiveChildren(false)
: Enumerable.Empty<BaseItem>(); : Array.Empty<BaseItem>();
foreach (var metadataPath in GetMetadataPaths(item, children)) foreach (var metadataPath in GetMetadataPaths(item, children))
{ {

@ -807,13 +807,11 @@ namespace MediaBrowser.Providers.Manager
where TLookupType : ItemLookupInfo where TLookupType : ItemLookupInfo
{ {
var results = await provider.GetSearchResults(searchInfo, cancellationToken).ConfigureAwait(false); var results = await provider.GetSearchResults(searchInfo, cancellationToken).ConfigureAwait(false);
return results.Select(result =>
foreach (var item in results)
{ {
item.SearchProviderName = provider.Name; result.SearchProviderName = provider.Name;
} return result;
});
return results;
} }
private IEnumerable<IExternalId> GetExternalIds(IHasProviderIds item) private IEnumerable<IExternalId> GetExternalIds(IHasProviderIds item)

Loading…
Cancel
Save