mirror of
https://github.com/sct/overseerr.git
synced 2025-09-17 17:24:35 +02:00
fix(quota): block multi-season requests that would exceed a user's quota (#1874)
* fix(quota): block multi-season requests that would exceed a user's quota * fix(docs): add missing request user option to API docs Co-authored-by: sct <ryan@sct.dev>
This commit is contained in:
@@ -4204,6 +4204,9 @@ paths:
|
|||||||
type: string
|
type: string
|
||||||
languageProfileId:
|
languageProfileId:
|
||||||
type: number
|
type: number
|
||||||
|
userId:
|
||||||
|
type: number
|
||||||
|
nullable: true
|
||||||
required:
|
required:
|
||||||
- mediaType
|
- mediaType
|
||||||
- mediaId
|
- mediaId
|
||||||
|
@@ -350,6 +350,14 @@ requestRoutes.post('/', async (req, res, next) => {
|
|||||||
status: 202,
|
status: 202,
|
||||||
message: 'No seasons available to request',
|
message: 'No seasons available to request',
|
||||||
});
|
});
|
||||||
|
} else if (
|
||||||
|
quotas.tv.limit &&
|
||||||
|
finalSeasons.length > (quotas.tv.remaining ?? 0)
|
||||||
|
) {
|
||||||
|
return next({
|
||||||
|
status: 403,
|
||||||
|
message: 'Series Quota Exceeded',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await mediaRepository.save(media);
|
await mediaRepository.save(media);
|
||||||
|
Reference in New Issue
Block a user