Skip to content
This repository was archived by the owner on Feb 15, 2026. It is now read-only.

feat(requests): add ability to limit users requests with quotas#945

Closed
ankarhem wants to merge 1 commit intosct:developfrom
ankarhem:add-quotas
Closed

feat(requests): add ability to limit users requests with quotas#945
ankarhem wants to merge 1 commit intosct:developfrom
ankarhem:add-quotas

Conversation

@ankarhem
Copy link
Contributor

Description

Screenshot (if UI related)

Todos

  • Sucessfully builds yarn build
  • Translation Keys yarn i18n:extract
  • Database migration created (if required)

Issues Fixed or Closed by this PR

@ankarhem ankarhem marked this pull request as ready for review February 16, 2021 22:22
Comment on lines +44 to +45
quotaPeriod: 'Default Quota Period (days)',
quotaQuantity: 'Default Quota Quantity (requests)',
Copy link
Collaborator

@TheCatLady TheCatLady Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
quotaPeriod: 'Default Quota Period (days)',
quotaQuantity: 'Default Quota Quantity (requests)',
requestLimit: 'Default Request Limit',

I think that while "Quota" makes sense for us as devs, "Request Limit" would be clearer and less confusing for the end user. We should also avoid parentheses in labels / field names; if parentheses are necessary, it probably needs to be reworded/renamed or have a "tip"/description added.

Also, I think that this should appear as one setting/option/row to the end user even though it's really two values, like:

Default Request Limit            [      ] requests per [      ] days

We also need Yup validation on these fields ("You must enter a number of requests" / "You must enter a number of days" if the user only enters one but not the other, or a non-numeric value?).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second thought, the quotaPeriod setting should probably be a dropdown with options for day/week/month (we can still store the value as 1/7/30 days).

Default Request Limit            [      ] requests per [ day   v ]
                                                       [ week    ]
                                                       [ month   ]

Then, we don't need validation on that field, and the quotaQuantity setting can be optional (so quotas only apply if a value is set).

get:
summary: Get quotas for a specific user
description: |
Retrieves quota details for a user in a JSON object.. Requires the `MANAGE_USERS` permission.
Copy link
Collaborator

@TheCatLady TheCatLady Feb 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Retrieves quota details for a user in a JSON object.. Requires the `MANAGE_USERS` permission.
Returns quota details for a user in a JSON object. Requires the `MANAGE_USERS` permission.

@Inrego
Copy link

Inrego commented Mar 2, 2021

I may be a bit late to the party, but another great addition would be the option to have separate limits for TV and Movies.

@ankarhem
Copy link
Contributor Author

ankarhem commented Mar 2, 2021

I may be a bit late to the party, but another great addition would be the option to have separate limits for TV and Movies.

I haven't updated this remotely but my rebased local branch does seperate this logic. You set one quota for movies, and one quota for how many seasons of TV you can request.

@ankarhem ankarhem requested a review from sct as a code owner March 8, 2021 08:17
@sct sct closed this Mar 24, 2021
OwsleyJr pushed a commit that referenced this pull request Oct 8, 2025
* feat: create the basis for the override rules

* feat: add support for sonarr and keywords to override rules

* feat: apply override rules in the media request

* feat: add users to override rules

* fix: save the settings modified by the override rules

* fix: resolve type errors

* style: run prettier

* fix: add missing migration

* fix: correct sonarr override rules

* fix: create PostgreSQL migration and fix SQLite migration

* fix: resolve type naming and fix i18n issue

* fix: remove unrelated changes to the PR
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ability to limit requests per user, quotas

4 participants