mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-06 11:09:28 +00:00
feat: Invalidate currently playing chapter when player position changes
This commit is contained in:
parent
36509913f2
commit
74dc9807d6
2 changed files with 5 additions and 1 deletions
|
|
@ -14,6 +14,10 @@ BookExpanded? currentlyPlayingBook(CurrentlyPlayingBookRef ref) {
|
||||||
@riverpod
|
@riverpod
|
||||||
BookChapter? currentPlayingChapter(CurrentPlayingChapterRef ref) {
|
BookChapter? currentPlayingChapter(CurrentPlayingChapterRef ref) {
|
||||||
final player = ref.watch(audiobookPlayerProvider);
|
final player = ref.watch(audiobookPlayerProvider);
|
||||||
|
player.positionStream.listen((_) {
|
||||||
|
ref.invalidateSelf();
|
||||||
|
});
|
||||||
|
|
||||||
return player.currentChapter;
|
return player.currentChapter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ final currentlyPlayingBookProvider =
|
||||||
|
|
||||||
typedef CurrentlyPlayingBookRef = AutoDisposeProviderRef<BookExpanded?>;
|
typedef CurrentlyPlayingBookRef = AutoDisposeProviderRef<BookExpanded?>;
|
||||||
String _$currentPlayingChapterHash() =>
|
String _$currentPlayingChapterHash() =>
|
||||||
r'3a621260211cddecfd974b31d5c4820ed24b1545';
|
r'91ca01ee93e0d556c77237ceebb3f9281d2d2b3f';
|
||||||
|
|
||||||
/// provided the current chapter of the book being played
|
/// provided the current chapter of the book being played
|
||||||
///
|
///
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue