feat(server): split generated content into a separate folder (#2047)

* feat: organize media folders

* fix: tests
This commit is contained in:
Jason Rasmussen 2023-03-25 10:50:57 -04:00 committed by GitHub
parent b862c20e8e
commit 2400004f41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 113 additions and 91 deletions

View file

@ -1,5 +1,5 @@
import { Inject, Injectable } from '@nestjs/common';
import { APP_UPLOAD_LOCATION, serverVersion } from '../domain.constant';
import { APP_MEDIA_LOCATION, serverVersion } from '../domain.constant';
import { asHumanReadable } from '../domain.util';
import { IStorageRepository } from '../storage';
import { IUserRepository, UserStatsQueryResponse } from '../user';
@ -13,7 +13,7 @@ export class ServerInfoService {
) {}
async getInfo(): Promise<ServerInfoResponseDto> {
const diskInfo = await this.storageRepository.checkDiskUsage(APP_UPLOAD_LOCATION);
const diskInfo = await this.storageRepository.checkDiskUsage(APP_MEDIA_LOCATION);
const usagePercentage = (((diskInfo.total - diskInfo.free) / diskInfo.total) * 100).toFixed(2);