Clean up list handling

Co-authored-by: Cody Robibero <cody@robibe.ro>
This commit is contained in:
Joe Rogers 2022-01-04 16:25:36 +01:00
parent 1dfbeae045
commit b17fe35e2e
No known key found for this signature in database
GPG Key ID: 0074AD57B8FDBBB4

View File

@ -78,11 +78,10 @@ namespace MediaBrowser.Providers.Manager
}
}
var oldBackdropImages = item.GetImages(ImageType.Backdrop).ToArray();
var toRemove = singular.Concat(oldBackdropImages).ToArray();
PruneImages(item, toRemove);
singular.AddRange(item.GetImages(ImageType.Backdrop));
PruneImages(item, singular);
return toRemove.Length > 0;
return singular.Count > 0;
}
/// <summary>
@ -354,9 +353,9 @@ namespace MediaBrowser.Providers.Manager
return true;
}
private void PruneImages(BaseItem item, ItemImageInfo[] images)
private void PruneImages(BaseItem item, IReadOnlyList<ItemImageInfo> images)
{
for (var i = 0; i < images.Length; i++)
for (var i = 0; i < images.Count; i++)
{
var image = images[i];