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 =
|
val mediaItem =
|
||||||
eventTime.timeline.getWindow(eventTime.windowIndex, Timeline.Window()).mediaItem
|
eventTime.timeline.getWindow(eventTime.windowIndex, Timeline.Window()).mediaItem
|
||||||
|
|
||||||
query {
|
val totalPlayTimeMs = playbackStats.totalPlayTimeMs
|
||||||
Database.incrementTotalPlayTimeMs(mediaItem.mediaId, playbackStats.totalPlayTimeMs)
|
|
||||||
|
if (totalPlayTimeMs > 2000) {
|
||||||
|
query {
|
||||||
|
Database.incrementTotalPlayTimeMs(mediaItem.mediaId, totalPlayTimeMs)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue