mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-13 16:40:01 +00:00
Fix check of request limit of limit is set to 0 (unlimited)
This commit is contained in:
@@ -102,7 +102,7 @@ class GameRequestService(
|
|||||||
listOf(GameRequestStatus.PENDING)
|
listOf(GameRequestStatus.PENDING)
|
||||||
)
|
)
|
||||||
val maxRequestsPerUser = config.get(ConfigProperties.Requests.Games.MaxOpenRequestsPerUser) ?: 0
|
val maxRequestsPerUser = config.get(ConfigProperties.Requests.Games.MaxOpenRequestsPerUser) ?: 0
|
||||||
if (maxRequestsPerUser == 0 || (auth?.isAdmin() != true && pendingRequestsForUser.size >= maxRequestsPerUser)) {
|
if (maxRequestsPerUser != 0 && auth?.isAdmin() != true && pendingRequestsForUser.size >= maxRequestsPerUser) {
|
||||||
throw EndpointException("You have reached the maximum number of pending requests (${maxRequestsPerUser})")
|
throw EndpointException("You have reached the maximum number of pending requests (${maxRequestsPerUser})")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user