mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-15 23:49:30 +00:00
progress visibility on item page
This commit is contained in:
parent
be7f5daa88
commit
865a662b56
21 changed files with 1009 additions and 765 deletions
|
|
@ -127,7 +127,7 @@ class AudiobookPlayer extends AudioPlayer {
|
|||
}).toList(),
|
||||
),
|
||||
).catchError((error) {
|
||||
debugPrint('Error: $error');
|
||||
debugPrint('AudiobookPlayer Error: $error');
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:shelfsdk/audiobookshelf_api.dart';
|
||||
import 'package:whispering_pages/features/player/providers/audiobook_player.dart';
|
||||
import 'package:whispering_pages/shared/extensions/model_conversions.dart';
|
||||
|
||||
part 'currently_playing_provider.g.dart';
|
||||
|
||||
|
|
@ -26,7 +27,7 @@ BookChapter? currentPlayingChapter(CurrentPlayingChapterRef ref) {
|
|||
BookMetadataExpanded? currentBookMetadata(CurrentBookMetadataRef ref) {
|
||||
final player = ref.watch(audiobookPlayerProvider);
|
||||
if (player.book == null) return null;
|
||||
return BookMetadataExpanded.fromJson(player.book!.metadata.toJson());
|
||||
return player.book!.metadata.asBookMetadataExpanded;
|
||||
}
|
||||
|
||||
// /// volume of the player [0, 1]
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ final currentPlayingChapterProvider =
|
|||
|
||||
typedef CurrentPlayingChapterRef = AutoDisposeProviderRef<BookChapter?>;
|
||||
String _$currentBookMetadataHash() =>
|
||||
r'02b462a051fce5bcbdad6fdb708b60256fbb588c';
|
||||
r'9088debba151894b61f2dcba1bba12a89244b9b1';
|
||||
|
||||
/// provides the book metadata of the currently playing book
|
||||
///
|
||||
|
|
|
|||
|
|
@ -1,5 +1,3 @@
|
|||
import 'dart:async';
|
||||
|
||||
import 'package:duration_picker/duration_picker.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
||||
|
|
@ -356,16 +354,3 @@ extension DurationFormat on Duration {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
void useInterval(VoidCallback callback, Duration delay) {
|
||||
final savedCallback = useRef(callback);
|
||||
savedCallback.value = callback;
|
||||
|
||||
useEffect(
|
||||
() {
|
||||
final timer = Timer.periodic(delay, (_) => savedCallback.value());
|
||||
return timer.cancel;
|
||||
},
|
||||
[delay],
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue