Never decrement the lastUsage of a session duration limitation

This commit is contained in:
Jonas Lochmann 2021-12-20 01:00:00 +01:00
parent 12fb7778f1
commit edc43734a8
No known key found for this signature in database
GPG key ID: 8B8C9AEE10FA5B36

View file

@ -1,5 +1,5 @@
/* /*
* TimeLimit Copyright <C> 2019 - 2020 Jonas Lochmann * TimeLimit Copyright <C> 2019 - 2021 Jonas Lochmann
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -117,7 +117,7 @@ object LocalDatabaseAppLogicActionDispatcher {
} }
oldItem.copy( oldItem.copy(
lastUsage = if (hasTrustedTimestamp) action.trustedTimestamp else oldItem.lastUsage, lastUsage = action.trustedTimestamp.coerceAtLeast(oldItem.lastUsage),
lastSessionDuration = if (extendSession) oldItem.lastSessionDuration + item.timeToAdd.toLong() else item.timeToAdd.toLong() lastSessionDuration = if (extendSession) oldItem.lastSessionDuration + item.timeToAdd.toLong() else item.timeToAdd.toLong()
) )
} else SessionDuration( } else SessionDuration(