mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 17:25:11 +03:00
chore: lint
This commit is contained in:
@@ -114,7 +114,7 @@ export class MaintenanceController {
|
||||
history: new HistoryBuilder().added('v9.9.9').alpha('v9.9.9'),
|
||||
})
|
||||
@Authenticated({ permission: Permission.Maintenance, admin: true })
|
||||
async downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||
downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||
res.header('Content-Disposition', 'attachment');
|
||||
res.sendFile(this.service.getBackupPath(filename));
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ export class MaintenanceWorkerController {
|
||||
|
||||
@Get('admin/maintenance/backups/:filename')
|
||||
@MaintenanceRoute()
|
||||
async downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||
downloadBackup(@Param() { filename }: FilenameParamDto, @Res() res: Response) {
|
||||
res.header('Content-Disposition', 'attachment');
|
||||
res.sendFile(this.service.getBackupPath(filename));
|
||||
}
|
||||
|
||||
@@ -56,8 +56,8 @@ export class BackupService extends BaseService {
|
||||
|
||||
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
||||
const files = await this.storageRepository.readdir(backupsFolder);
|
||||
const backups = files.filter(isValidRoutineBackupName);
|
||||
const failedBackups = files.filter(isFailedBackupName);
|
||||
const backups = files.filter((fn) => isValidRoutineBackupName(fn));
|
||||
const failedBackups = files.filter((fn) => isFailedBackupName(fn));
|
||||
|
||||
const toDelete = backups.slice(config.keepLastAmount);
|
||||
toDelete.push(...failedBackups);
|
||||
|
||||
@@ -267,8 +267,8 @@ export async function listBackups({ storage }: Pick<BackupRepos, 'storage'>): Pr
|
||||
const backupsFolder = StorageCore.getBaseFolder(StorageFolder.Backups);
|
||||
const files = await storage.readdir(backupsFolder);
|
||||
return files
|
||||
.filter(isValidBackupName)
|
||||
.sort((a, b) => (a.startsWith('uploaded-') !== b.startsWith('uploaded-') ? 1 : a.localeCompare(b)))
|
||||
.filter((fn) => isValidBackupName(fn))
|
||||
.sort((a, b) => (a.startsWith('uploaded-') === b.startsWith('uploaded-') ? a.localeCompare(b) : 1))
|
||||
.toReversed();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user