chore: 优化进度条显示

This commit is contained in:
rang 2026-01-13 11:56:49 +08:00
parent 03cec3f4b6
commit d96995a863
27 changed files with 1229 additions and 1311 deletions

View file

@ -73,6 +73,7 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
bookSettings.copyWith
.playerSettings(skipChapterStart: interval),
);
reloadPlayer(ref);
},
),
),
@ -97,6 +98,7 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
bookSettings.copyWith
.playerSettings(skipChapterEnd: interval),
);
reloadPlayer(ref);
},
),
),
@ -104,4 +106,15 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
),
);
}
void reloadPlayer(WidgetRef ref) {
final currentBook = ref.watch(currentBookProvider);
if (currentBook == null) {
return;
}
final absPlayer = ref.read(absPlayerProvider);
final positionInBook = absPlayer.positionInBook;
ref.read(currentBookProvider.notifier).update(currentBook.libraryItemId,
force: true, currentTime: positionInBook);
}
}