Skip to content

Commit

Permalink
fix: track stops at last second
Browse files Browse the repository at this point in the history
  • Loading branch information
KRTirtho committed Jun 30, 2023
1 parent 0cfe430 commit f554f6d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions lib/pages/lyrics/synced_lyrics.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ class SyncedLyrics extends HookConsumerWidget {
: FontWeight.normal,
fontSize: (isActive ? 28 : 26) *
(textZoomLevel.value / 100),
shadows: kElevationToShadow[9],
),
child: Text(
lyricSlice.text,
Expand Down
18 changes: 9 additions & 9 deletions lib/provider/proxy_playlist/proxy_playlist_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
}
}

if (oldTrack != null && track != null) {
await storeTrack(
oldTrack,
track,
);
}
} finally {
isPreSearching = false;

/// Sometimes fetching can take a lot of time, so we need to check
/// if next source is playable or not at 99% progress. If not, then
/// it'll be paused automatically
Expand All @@ -151,15 +160,6 @@ class ProxyPlaylistNotifier extends PersistedStateNotifier<ProxyPlaylist>
if (audioPlayer.isPaused) {
await audioPlayer.resume();
}

if (oldTrack != null && track != null) {
await storeTrack(
oldTrack,
track,
);
}
} finally {
isPreSearching = false;
}
}

Expand Down

0 comments on commit f554f6d

Please sign in to comment.