mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
chore: finish migrating eslint config files; bump unicorn (#17200)
This commit is contained in:
parent
e4f83680d9
commit
238c151ac3
23 changed files with 883 additions and 1286 deletions
|
|
@ -121,7 +121,7 @@ class SqlGenerator {
|
|||
|
||||
for (const key of this.getPropertyNames(instance)) {
|
||||
const target = instance[key];
|
||||
if (!(target instanceof Function)) {
|
||||
if (!(typeof target === 'function')) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,7 +91,9 @@ export class MachineLearningRepository {
|
|||
signal: AbortSignal.timeout(MACHINE_LEARNING_PING_TIMEOUT),
|
||||
});
|
||||
active = response.ok;
|
||||
} catch {}
|
||||
} catch {
|
||||
// nothing to do here
|
||||
}
|
||||
this.setUrlAvailability(url, active);
|
||||
return active;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ describe(NotificationRepository.name, () => {
|
|||
let sut: NotificationRepository;
|
||||
|
||||
beforeEach(() => {
|
||||
// eslint-disable-next-line no-sparse-arrays
|
||||
sut = new NotificationRepository(automock(LoggingRepository, { args: [, { getEnv: () => ({}) }], strict: false }));
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ export class PersonRepository {
|
|||
.$if(!!faceIds, (qb) => qb.where('asset_faces.id', 'in', faceIds!))
|
||||
.executeTakeFirst();
|
||||
|
||||
return Number(result.numChangedRows) ?? 0;
|
||||
return Number(result.numChangedRows ?? 0);
|
||||
}
|
||||
|
||||
@GenerateSql({ params: [{ sourceType: SourceType.EXIF }] })
|
||||
|
|
@ -269,7 +269,7 @@ export class PersonRepository {
|
|||
.where('asset_faces.id', '=', assetFaceId)
|
||||
.executeTakeFirst();
|
||||
|
||||
return Number(result.numChangedRows) ?? 0;
|
||||
return Number(result.numChangedRows ?? 0);
|
||||
}
|
||||
|
||||
getById(personId: string): Promise<PersonEntity | null> {
|
||||
|
|
|
|||
|
|
@ -183,6 +183,7 @@ describe(StorageRepository.name, () => {
|
|||
let sut: StorageRepository;
|
||||
|
||||
beforeEach(() => {
|
||||
// eslint-disable-next-line no-sparse-arrays
|
||||
sut = new StorageRepository(automock(LoggingRepository, { args: [, { getEnv: () => ({}) }], strict: false }));
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -236,7 +236,6 @@ export class UserRepository {
|
|||
stat.usage = Number(stat.usage);
|
||||
stat.usagePhotos = Number(stat.usagePhotos);
|
||||
stat.usageVideos = Number(stat.usageVideos);
|
||||
stat.quotaSizeInBytes = stat.quotaSizeInBytes;
|
||||
}
|
||||
|
||||
return stats;
|
||||
|
|
|
|||
|
|
@ -103,7 +103,9 @@ export class ApiService {
|
|||
break;
|
||||
}
|
||||
}
|
||||
} catch {}
|
||||
} catch {
|
||||
// nothing to do here
|
||||
}
|
||||
|
||||
res.type('text/html').header('Cache-Control', 'no-store').send(html);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { default as path } from 'node:path';
|
||||
import path from 'node:path';
|
||||
import semver from 'semver';
|
||||
import { StorageCore } from 'src/cores/storage.core';
|
||||
import { OnEvent, OnJob } from 'src/decorators';
|
||||
|
|
|
|||
|
|
@ -250,10 +250,6 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
|
|||
return access.memory.checkOwnerAccess(auth.user.id, ids);
|
||||
}
|
||||
|
||||
case Permission.MEMORY_DELETE: {
|
||||
return access.memory.checkOwnerAccess(auth.user.id, ids);
|
||||
}
|
||||
|
||||
case Permission.PERSON_READ: {
|
||||
return await access.person.checkOwnerAccess(auth.user.id, ids);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue