diff --git a/src/Applications/UI/Tracks.elm b/src/Applications/UI/Tracks.elm index 58dc9276..f618ad8b 100644 --- a/src/Applications/UI/Tracks.elm +++ b/src/Applications/UI/Tracks.elm @@ -93,7 +93,20 @@ update msg model = ) ScrollToNowPlaying -> - case model.nowPlaying of + let + -- The index identifier might be out-of-date, + -- so we get the latest version. + it = + model.nowPlaying + |> Maybe.map (Tuple.second >> .id) + |> Maybe.andThen + (\id -> + List.find + (Tuple.second >> .id >> (==) id) + model.collection.harvested + ) + in + case it of Just identifiedTrack -> case model.scene of List -> diff --git a/src/Library/Tracks/Collection/Internal/Harvest.elm b/src/Library/Tracks/Collection/Internal/Harvest.elm index 488bbdb5..16a0f2c5 100644 --- a/src/Library/Tracks/Collection/Internal/Harvest.elm +++ b/src/Library/Tracks/Collection/Internal/Harvest.elm @@ -68,7 +68,7 @@ harvest ( deps, collection ) = else identity ) - |> List.indexedMap (\idx tup -> Tuple.mapFirst (\i -> { i | indexInList = idx }) tup) + |> List.indexedMap (\idx -> Tuple.mapFirst (\i -> { i | indexInList = idx })) |> (\h -> { collection | harvested = h }) |> (\c -> ( deps, c ))