diff --git a/server/entity/User.ts b/server/entity/User.ts index ed6fc4a6b..766ef76f0 100644 --- a/server/entity/User.ts +++ b/server/entity/User.ts @@ -307,7 +307,7 @@ export class User { limit: movieQuotaLimit, used: movieQuotaUsed, remaining: movieQuotaLimit - ? movieQuotaLimit - movieQuotaUsed + ? Math.max(0, movieQuotaLimit - movieQuotaUsed) : undefined, restricted: movieQuotaLimit && movieQuotaLimit - movieQuotaUsed <= 0 @@ -318,7 +318,9 @@ export class User { days: tvQuotaDays, limit: tvQuotaLimit, used: tvQuotaUsed, - remaining: tvQuotaLimit ? tvQuotaLimit - tvQuotaUsed : undefined, + remaining: tvQuotaLimit + ? Math.max(0, tvQuotaLimit - tvQuotaUsed) + : undefined, restricted: tvQuotaLimit && tvQuotaLimit - tvQuotaUsed <= 0 ? true : false, }, diff --git a/src/components/RequestModal/QuotaDisplay/index.tsx b/src/components/RequestModal/QuotaDisplay/index.tsx index 223540d5d..a044f954f 100644 --- a/src/components/RequestModal/QuotaDisplay/index.tsx +++ b/src/components/RequestModal/QuotaDisplay/index.tsx @@ -59,18 +59,14 @@ const QuotaDisplay: React.FC = ({
= ({ {overLimit !== undefined ? intl.formatMessage(messages.notenoughseasonrequests) : intl.formatMessage(messages.requestsremaining, { - remaining: Math.max(0, remaining ?? quota?.remaining ?? 0), + remaining: remaining ?? quota?.remaining ?? 0, type: intl.formatMessage( mediaType === 'movie' ? messages.movie : messages.season ), diff --git a/src/components/UserProfile/index.tsx b/src/components/UserProfile/index.tsx index 80131ae49..926455330 100644 --- a/src/components/UserProfile/index.tsx +++ b/src/components/UserProfile/index.tsx @@ -134,13 +134,10 @@ const UserProfile: React.FC = () => { {quota.movie.limit ? ( <> { {quota.tv.limit ? ( <>