More puny

This commit is contained in:
syuilo
2019-04-10 00:59:41 +09:00
parent 72a5f7b1e2
commit 236d72685d
14 changed files with 52 additions and 55 deletions

View File

@ -3,6 +3,7 @@ import { DriveFile } from '../entities/drive-file';
import { Users, DriveFolders } from '..';
import rap from '@prezzemolo/rap';
import { User } from '../entities/user';
import { toPuny } from '../../misc/convert-host';
@EntityRepository(DriveFile)
export class DriveFileRepository extends Repository<DriveFile> {
@ -39,7 +40,7 @@ export class DriveFileRepository extends Repository<DriveFile> {
public async clacDriveUsageOfHost(host: string): Promise<number> {
const { sum } = await this
.createQueryBuilder('file')
.where('file.userHost = :host', { host: host })
.where('file.userHost = :host', { host: toPuny(host) })
.select('SUM(file.size)', 'sum')
.getRawOne();