Fix possible multiple enumeration in update collections

This commit is contained in:
Bogdan 2023-12-31 09:49:17 +02:00
parent 3c6386f318
commit dae46524c4
1 changed files with 2 additions and 2 deletions

View File

@ -98,7 +98,7 @@ namespace Radarr.Api.V3.Collections
[HttpPut]
public ActionResult UpdateCollections(CollectionUpdateResource resource)
{
var collectionsToUpdate = _collectionService.GetCollections(resource.CollectionIds);
var collectionsToUpdate = _collectionService.GetCollections(resource.CollectionIds).ToList();
foreach (var collection in collectionsToUpdate)
{
@ -132,7 +132,7 @@ namespace Radarr.Api.V3.Collections
}
}
var updated = _collectionService.UpdateCollections(collectionsToUpdate.ToList()).ToResource();
var updated = _collectionService.UpdateCollections(collectionsToUpdate).ToResource();
_commandQueueManager.Push(new RefreshCollectionsCommand());