|
|
@ -236,11 +236,9 @@ export class User {
|
|
|
|
const movieDate = new Date();
|
|
|
|
const movieDate = new Date();
|
|
|
|
if (movieQuotaDays) {
|
|
|
|
if (movieQuotaDays) {
|
|
|
|
movieDate.setDate(movieDate.getDate() - movieQuotaDays);
|
|
|
|
movieDate.setDate(movieDate.getDate() - movieQuotaDays);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
movieDate.setDate(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// YYYY-MM-DD format
|
|
|
|
const movieQuotaStartDate = movieDate.toJSON();
|
|
|
|
const movieQuotaStartDate = movieDate.toJSON().split('T')[0];
|
|
|
|
|
|
|
|
const movieQuotaUsed = movieQuotaLimit
|
|
|
|
const movieQuotaUsed = movieQuotaLimit
|
|
|
|
? await requestRepository.count({
|
|
|
|
? await requestRepository.count({
|
|
|
|
where: {
|
|
|
|
where: {
|
|
|
@ -261,11 +259,8 @@ export class User {
|
|
|
|
const tvDate = new Date();
|
|
|
|
const tvDate = new Date();
|
|
|
|
if (tvQuotaDays) {
|
|
|
|
if (tvQuotaDays) {
|
|
|
|
tvDate.setDate(tvDate.getDate() - tvQuotaDays);
|
|
|
|
tvDate.setDate(tvDate.getDate() - tvQuotaDays);
|
|
|
|
} else {
|
|
|
|
|
|
|
|
tvDate.setDate(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// YYYY-MM-DD format
|
|
|
|
const tvQuotaStartDate = tvDate.toJSON();
|
|
|
|
const tvQuotaStartDate = tvDate.toJSON().split('T')[0];
|
|
|
|
|
|
|
|
const tvQuotaUsed = tvQuotaLimit
|
|
|
|
const tvQuotaUsed = tvQuotaLimit
|
|
|
|
? (
|
|
|
|
? (
|
|
|
|
await requestRepository
|
|
|
|
await requestRepository
|
|
|
|