Skip to content

Commit d3c6bc1

Browse files
authored
fix(quotas): Time value of a quota was being ignored
1 parent 9b199b2 commit d3c6bc1

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

‎.gitattributes‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text eol=lf

‎server/entity/User.ts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,11 +236,9 @@ export class User {
236236
const movieDate = new Date();
237237
if (movieQuotaDays) {
238238
movieDate.setDate(movieDate.getDate() - movieQuotaDays);
239-
} else {
240-
movieDate.setDate(0);
241239
}
242-
// YYYY-MM-DD format
243-
const movieQuotaStartDate = movieDate.toJSON().split('T')[0];
240+
const movieQuotaStartDate = movieDate.toJSON();
241+
244242
const movieQuotaUsed = movieQuotaLimit
245243
? await requestRepository.count({
246244
where: {
@@ -261,11 +259,8 @@ export class User {
261259
const tvDate = new Date();
262260
if (tvQuotaDays) {
263261
tvDate.setDate(tvDate.getDate() - tvQuotaDays);
264-
} else {
265-
tvDate.setDate(0);
266262
}
267-
// YYYY-MM-DD format
268-
const tvQuotaStartDate = tvDate.toJSON().split('T')[0];
263+
const tvQuotaStartDate = tvDate.toJSON();
269264
const tvQuotaUsed = tvQuotaLimit
270265
? (
271266
await requestRepository

0 commit comments

Comments
 (0)