feat: add player settings page and enhance settings UI (#33)

This commit is contained in:
Dr.Blank 2024-09-26 04:30:51 -04:00 committed by GitHub
parent 8049a660e6
commit 150e5c9025
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 761 additions and 157 deletions

View file

@ -166,7 +166,8 @@ class PlaybackReporter {
return _session!;
}
if (player.book == null) {
throw NoAudiobookPlayingError();
_logger.warning('No audiobook playing to start session');
return null;
}
_session = await authenticatedApi.items.play(
libraryItemId: player.book!.libraryItemId,
@ -204,8 +205,11 @@ class PlaybackReporter {
}
try {
_session ??= await startSession();
} on NoAudiobookPlayingError {
_logger.warning('No audiobook playing to sync position');
} on Error catch (e) {
_logger.warning('Error starting session: $e');
}
if (_session == null) {
_logger.warning('No session to sync position');
return;
}
final currentPosition = player.positionInBook;