feat: Invalidate currently playing chapter when player position changes

This commit is contained in:
Dr-Blank 2024-05-19 09:51:06 -04:00
parent 36509913f2
commit 74dc9807d6
No known key found for this signature in database
GPG key ID: 7452CC63F210A266
2 changed files with 5 additions and 1 deletions

View file

@ -14,6 +14,10 @@ BookExpanded? currentlyPlayingBook(CurrentlyPlayingBookRef ref) {
@riverpod
BookChapter? currentPlayingChapter(CurrentPlayingChapterRef ref) {
final player = ref.watch(audiobookPlayerProvider);
player.positionStream.listen((_) {
ref.invalidateSelf();
});
return player.currentChapter;
}