mirror of
https://github.com/advplyr/audiobookshelf-app.git
synced 2025-08-04 18:15:01 +02:00
Merge pull request #456 from benonymity/listeningStatsFix
Fix Listening Stats
This commit is contained in:
commit
139a0b3412
1 changed files with 8 additions and 0 deletions
|
@ -151,6 +151,14 @@ class PlayerProgress {
|
|||
} else {
|
||||
let playbackReport = PlaybackReport(currentTime: session.currentTime, duration: session.duration, timeListened: session.timeListening)
|
||||
success = await ApiClient.reportPlaybackProgress(report: playbackReport, sessionId: session.id)
|
||||
// Reset time listening becuase server expects that time to be since last sync, not for the whole session
|
||||
if success {
|
||||
if let session = session.thaw() {
|
||||
try session.update {
|
||||
session.timeListening = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue