Do not increment totalPlayTimeMs of a song if shorter than 2 seconds
This commit is contained in:
parent
78c9950e95
commit
8ae7bd96f5
1 changed files with 6 additions and 2 deletions
|
@ -261,8 +261,12 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene
|
|||
val mediaItem =
|
||||
eventTime.timeline.getWindow(eventTime.windowIndex, Timeline.Window()).mediaItem
|
||||
|
||||
query {
|
||||
Database.incrementTotalPlayTimeMs(mediaItem.mediaId, playbackStats.totalPlayTimeMs)
|
||||
val totalPlayTimeMs = playbackStats.totalPlayTimeMs
|
||||
|
||||
if (totalPlayTimeMs > 2000) {
|
||||
query {
|
||||
Database.incrementTotalPlayTimeMs(mediaItem.mediaId, totalPlayTimeMs)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue