Do not increment totalPlayTimeMs of a song if shorter than 2 seconds
This commit is contained in:
@@ -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)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user