Skip to content

Commit

Permalink
(#98) Fix windows crash when searching for albums too fast
Browse files Browse the repository at this point in the history
  • Loading branch information
Difegue committed Sep 4, 2024
1 parent 9611a95 commit 1ee2b2a
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Sources/Stylophone/ViewModels/LibraryViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public void RangesChanged(ItemIndexRange visibleRange, IReadOnlyList<ItemIndexRa
// Try to show album artwork early if we have it in cache
for (var i = visibleRange.FirstIndex; i < visibleRange.LastIndex + 1; i++) // Increment LastIndex by one to properly cover the visible range
{
if (i >= this.Count)
{
// The collection changed while this task was queued up, give up
return;
}

var album = this[i];
await album.LoadAlbumArtFromCacheAsync();
}
Expand Down

0 comments on commit 1ee2b2a

Please sign in to comment.