媒体库上拉刷新,下拉加载

This commit is contained in:
rang 2025-12-30 17:02:28 +08:00
parent bdd85efcd8
commit ebcbe1774a
20 changed files with 351 additions and 126 deletions

View file

@ -213,12 +213,12 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final me = ref.watch(meProvider);
final currentBook = ref.watch(currentBookProvider);
final playerStateNotifier = ref.watch(playerStateProvider.notifier);
final playing = ref.watch(playerStateProvider.select((v) => v.playing));
final playerStateNotifier = ref.read(playerStateProvider.notifier);
final isLoading = playerStateNotifier.isLoading(libraryItemId);
final isCurrentBookSetInPlayer =
currentBook?.libraryItemId == libraryItemId;
final isPlayingThisBook =
playerStateNotifier.isPlaying() && isCurrentBookSetInPlayer;
final isPlayingThisBook = playing && isCurrentBookSetInPlayer;
final userProgress = me.valueOrNull?.mediaProgress
?.firstWhereOrNull((element) => element.libraryItemId == libraryItemId);