mirror of
https://github.com/immich-app/immich.git
synced 2024-12-28 06:31:58 +00:00
parent
40854f358c
commit
5e6ac87eaf
23 changed files with 30 additions and 28 deletions
|
@ -55,6 +55,7 @@ export default [
|
||||||
'unicorn/import-style': 'off',
|
'unicorn/import-style': 'off',
|
||||||
curly: 2,
|
curly: 2,
|
||||||
'prettier/prettier': 0,
|
'prettier/prettier': 0,
|
||||||
|
'object-shorthand': ['error', 'always'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -59,6 +59,7 @@ export default [
|
||||||
'unicorn/prefer-top-level-await': 'off',
|
'unicorn/prefer-top-level-await': 'off',
|
||||||
'unicorn/prefer-event-target': 'off',
|
'unicorn/prefer-event-target': 'off',
|
||||||
'unicorn/no-thenable': 'off',
|
'unicorn/no-thenable': 'off',
|
||||||
|
'object-shorthand': ['error', 'always'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -63,6 +63,7 @@ export default [
|
||||||
'@typescript-eslint/require-await': 'error',
|
'@typescript-eslint/require-await': 'error',
|
||||||
curly: 2,
|
curly: 2,
|
||||||
'prettier/prettier': 0,
|
'prettier/prettier': 0,
|
||||||
|
'object-shorthand': ['error', 'always'],
|
||||||
|
|
||||||
'no-restricted-imports': [
|
'no-restricted-imports': [
|
||||||
'error',
|
'error',
|
||||||
|
|
|
@ -13,7 +13,7 @@ export class CreateProfileImageResponseDto {
|
||||||
|
|
||||||
export function mapCreateProfileImageResponse(userId: string, profileImagePath: string): CreateProfileImageResponseDto {
|
export function mapCreateProfileImageResponse(userId: string, profileImagePath: string): CreateProfileImageResponseDto {
|
||||||
return {
|
return {
|
||||||
userId: userId,
|
userId,
|
||||||
profileImagePath: profileImagePath,
|
profileImagePath,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -317,7 +317,7 @@ export class MapRepository implements IMapRepository {
|
||||||
}
|
}
|
||||||
|
|
||||||
const input = createReadStream(filePath);
|
const input = createReadStream(filePath);
|
||||||
const lineReader = readLine.createInterface({ input: input });
|
const lineReader = readLine.createInterface({ input });
|
||||||
|
|
||||||
const adminMap = new Map<string, string>();
|
const adminMap = new Map<string, string>();
|
||||||
for await (const line of lineReader) {
|
for await (const line of lineReader) {
|
||||||
|
|
|
@ -239,7 +239,7 @@ export class AlbumService {
|
||||||
throw new BadRequestException('User not found');
|
throw new BadRequestException('User not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
await this.albumUserRepository.create({ userId: userId, albumId: id, role });
|
await this.albumUserRepository.create({ userId, albumId: id, role });
|
||||||
await this.eventRepository.emit('album.invite', { id, userId });
|
await this.eventRepository.emit('album.invite', { id, userId });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ const fixtures = {
|
||||||
};
|
};
|
||||||
|
|
||||||
const oauthUserWithDefaultQuota = {
|
const oauthUserWithDefaultQuota = {
|
||||||
email: email,
|
email,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
oauthId: sub,
|
oauthId: sub,
|
||||||
quotaSizeInBytes: 1_073_741_824,
|
quotaSizeInBytes: 1_073_741_824,
|
||||||
|
@ -561,7 +561,7 @@ describe('AuthService', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(userMock.create).toHaveBeenCalledWith({
|
expect(userMock.create).toHaveBeenCalledWith({
|
||||||
email: email,
|
email,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
oauthId: sub,
|
oauthId: sub,
|
||||||
quotaSizeInBytes: null,
|
quotaSizeInBytes: null,
|
||||||
|
@ -581,7 +581,7 @@ describe('AuthService', () => {
|
||||||
);
|
);
|
||||||
|
|
||||||
expect(userMock.create).toHaveBeenCalledWith({
|
expect(userMock.create).toHaveBeenCalledWith({
|
||||||
email: email,
|
email,
|
||||||
name: ' ',
|
name: ' ',
|
||||||
oauthId: sub,
|
oauthId: sub,
|
||||||
quotaSizeInBytes: 5_368_709_120,
|
quotaSizeInBytes: 5_368_709_120,
|
||||||
|
|
|
@ -421,7 +421,7 @@ export class AuthService {
|
||||||
await this.sessionRepository.update({ id: session.id, updatedAt: new Date() });
|
await this.sessionRepository.update({ id: session.id, updatedAt: new Date() });
|
||||||
}
|
}
|
||||||
|
|
||||||
return { user: session.user, session: session };
|
return { user: session.user, session };
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new UnauthorizedException('Invalid user token');
|
throw new UnauthorizedException('Invalid user token');
|
||||||
|
|
|
@ -339,7 +339,7 @@ export class LibraryService {
|
||||||
const libraryId = job.id;
|
const libraryId = job.id;
|
||||||
|
|
||||||
const assetPagination = usePagination(JOBS_LIBRARY_PAGINATION_SIZE, (pagination) =>
|
const assetPagination = usePagination(JOBS_LIBRARY_PAGINATION_SIZE, (pagination) =>
|
||||||
this.assetRepository.getAll(pagination, { libraryId: libraryId, withDeleted: true }),
|
this.assetRepository.getAll(pagination, { libraryId, withDeleted: true }),
|
||||||
);
|
);
|
||||||
|
|
||||||
let assetsFound = false;
|
let assetsFound = false;
|
||||||
|
@ -465,7 +465,7 @@ export class LibraryService {
|
||||||
libraryId: job.id,
|
libraryId: job.id,
|
||||||
checksum: pathHash,
|
checksum: pathHash,
|
||||||
originalPath: assetPath,
|
originalPath: assetPath,
|
||||||
deviceAssetId: deviceAssetId,
|
deviceAssetId,
|
||||||
deviceId: 'Library Import',
|
deviceId: 'Library Import',
|
||||||
fileCreatedAt: stats.mtime,
|
fileCreatedAt: stats.mtime,
|
||||||
fileModifiedAt: stats.mtime,
|
fileModifiedAt: stats.mtime,
|
||||||
|
|
|
@ -309,7 +309,7 @@ describe(StorageTemplateService.name, () => {
|
||||||
entityId: assetStub.image.id,
|
entityId: assetStub.image.id,
|
||||||
pathType: AssetPathType.ORIGINAL,
|
pathType: AssetPathType.ORIGINAL,
|
||||||
oldPath: assetStub.image.originalPath,
|
oldPath: assetStub.image.originalPath,
|
||||||
newPath: newPath,
|
newPath,
|
||||||
});
|
});
|
||||||
expect(storageMock.rename).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);
|
expect(storageMock.rename).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);
|
||||||
expect(storageMock.copyFile).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);
|
expect(storageMock.copyFile).toHaveBeenCalledWith(assetStub.image.originalPath, newPath);
|
||||||
|
|
|
@ -227,7 +227,7 @@ export class StorageTemplateService {
|
||||||
const storagePath = this.render(this.template.compiled, {
|
const storagePath = this.render(this.template.compiled, {
|
||||||
asset,
|
asset,
|
||||||
filename: sanitized,
|
filename: sanitized,
|
||||||
extension: extension,
|
extension,
|
||||||
albumName,
|
albumName,
|
||||||
});
|
});
|
||||||
const fullPath = path.normalize(path.join(rootPath, storagePath));
|
const fullPath = path.normalize(path.join(rootPath, storagePath));
|
||||||
|
|
2
server/test/fixtures/asset.stub.ts
vendored
2
server/test/fixtures/asset.stub.ts
vendored
|
@ -31,7 +31,7 @@ const files: AssetFileEntity[] = [previewFile, thumbnailFile];
|
||||||
export const stackStub = (stackId: string, assets: AssetEntity[]): StackEntity => {
|
export const stackStub = (stackId: string, assets: AssetEntity[]): StackEntity => {
|
||||||
return {
|
return {
|
||||||
id: stackId,
|
id: stackId,
|
||||||
assets: assets,
|
assets,
|
||||||
owner: assets[0].owner,
|
owner: assets[0].owner,
|
||||||
ownerId: assets[0].ownerId,
|
ownerId: assets[0].ownerId,
|
||||||
primaryAsset: assets[0],
|
primaryAsset: assets[0],
|
||||||
|
|
|
@ -87,6 +87,7 @@ export default [
|
||||||
'@typescript-eslint/no-floating-promises': 'error',
|
'@typescript-eslint/no-floating-promises': 'error',
|
||||||
'@typescript-eslint/no-misused-promises': 'error',
|
'@typescript-eslint/no-misused-promises': 'error',
|
||||||
'@typescript-eslint/require-await': 'error',
|
'@typescript-eslint/require-await': 'error',
|
||||||
|
'object-shorthand': ['error', 'always'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -81,7 +81,7 @@
|
||||||
const mergedPerson = await getPerson({ id: person.id });
|
const mergedPerson = await getPerson({ id: person.id });
|
||||||
const count = results.filter(({ success }) => success).length;
|
const count = results.filter(({ success }) => success).length;
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
message: $t('merged_people_count', { values: { count: count } }),
|
message: $t('merged_people_count', { values: { count } }),
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
});
|
});
|
||||||
dispatch('merge', mergedPerson);
|
dispatch('merge', mergedPerson);
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
const count = results.filter(({ success }) => success).length;
|
const count = results.filter(({ success }) => success).length;
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
message: $t('assets_removed_count', { values: { count: count } }),
|
message: $t('assets_removed_count', { values: { count } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
clearSelect();
|
clearSelect();
|
||||||
|
|
|
@ -45,7 +45,7 @@
|
||||||
|
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
message: $t('assets_removed_count', { values: { count: count } }),
|
message: $t('assets_removed_count', { values: { count } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
clearSelect();
|
clearSelect();
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
if (!heightPending) {
|
if (!heightPending) {
|
||||||
const height = element.getBoundingClientRect().height;
|
const height = element.getBoundingClientRect().height;
|
||||||
if (height !== 0) {
|
if (height !== 0) {
|
||||||
$assetStore.updateBucket(bucket.bucketDate, { height: height, measured: true });
|
$assetStore.updateBucket(bucket.bucketDate, { height, measured: true });
|
||||||
}
|
}
|
||||||
|
|
||||||
onMeasured();
|
onMeasured();
|
||||||
|
@ -65,9 +65,7 @@
|
||||||
<section id="measure-asset-group-by-date" class="flex flex-wrap gap-x-12" use:measure>
|
<section id="measure-asset-group-by-date" class="flex flex-wrap gap-x-12" use:measure>
|
||||||
{#each bucket.dateGroups as dateGroup}
|
{#each bucket.dateGroups as dateGroup}
|
||||||
<div id="date-group" data-date-group={dateGroup.date}>
|
<div id="date-group" data-date-group={dateGroup.date}>
|
||||||
<div
|
<div use:resizeObserver={({ height }) => $assetStore.updateBucketDateGroup(bucket, dateGroup, { height })}>
|
||||||
use:resizeObserver={({ height }) => $assetStore.updateBucketDateGroup(bucket, dateGroup, { height: height })}
|
|
||||||
>
|
|
||||||
<div
|
<div
|
||||||
class="flex z-[100] sticky top-[-1px] pt-7 pb-5 h-6 place-items-center text-xs font-medium text-immich-fg bg-immich-bg dark:bg-immich-dark-bg dark:text-immich-dark-fg md:text-sm"
|
class="flex z-[100] sticky top-[-1px] pt-7 pb-5 h-6 place-items-center text-xs font-medium text-immich-fg bg-immich-bg dark:bg-immich-dark-bg dark:text-immich-dark-fg md:text-sm"
|
||||||
style:width={dateGroup.geometry.containerWidth + 'px'}
|
style:width={dateGroup.geometry.containerWidth + 'px'}
|
||||||
|
|
|
@ -50,7 +50,7 @@ describe('ShareCover component', () => {
|
||||||
it.skip('renders fallback image when asset is not resized', () => {
|
it.skip('renders fallback image when asset is not resized', () => {
|
||||||
const link = sharedLinkFactory.build({ assets: [assetFactory.build()] });
|
const link = sharedLinkFactory.build({ assets: [assetFactory.build()] });
|
||||||
render(ShareCover, {
|
render(ShareCover, {
|
||||||
link: link,
|
link,
|
||||||
preload: false,
|
preload: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -350,7 +350,7 @@ class IntersectionTask {
|
||||||
this.internalTaskManager.queueScrollSensitiveTask({
|
this.internalTaskManager.queueScrollSensitiveTask({
|
||||||
task,
|
task,
|
||||||
cleanup,
|
cleanup,
|
||||||
componentId: componentId,
|
componentId,
|
||||||
priority: this.priority,
|
priority: this.priority,
|
||||||
taskId: this.intersectedKey,
|
taskId: this.intersectedKey,
|
||||||
});
|
});
|
||||||
|
@ -367,7 +367,7 @@ class IntersectionTask {
|
||||||
this.internalTaskManager.queueSeparateTask({
|
this.internalTaskManager.queueSeparateTask({
|
||||||
task,
|
task,
|
||||||
cleanup,
|
cleanup,
|
||||||
componentId: componentId,
|
componentId,
|
||||||
taskId: this.separatedKey,
|
taskId: this.separatedKey,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,7 @@ export const addAssetsToAlbum = async (albumId: string, assetIds: string[], show
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
message:
|
message:
|
||||||
count > 0
|
count > 0
|
||||||
? $t('assets_added_to_album_count', { values: { count: count } })
|
? $t('assets_added_to_album_count', { values: { count } })
|
||||||
: $t('assets_were_part_of_album_count', { values: { count: assetIds.length } }),
|
: $t('assets_were_part_of_album_count', { values: { count: assetIds.length } }),
|
||||||
button: {
|
button: {
|
||||||
text: $t('view_album'),
|
text: $t('view_album'),
|
||||||
|
@ -264,7 +264,7 @@ export const downloadFile = async (asset: AssetResponseDto) => {
|
||||||
|
|
||||||
downloadBlob(data, filename);
|
downloadBlob(data, filename);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
handleError(error, $t('errors.error_downloading', { values: { filename: filename } }));
|
handleError(error, $t('errors.error_downloading', { values: { filename } }));
|
||||||
downloadManager.clear(downloadKey);
|
downloadManager.clear(downloadKey);
|
||||||
} finally {
|
} finally {
|
||||||
setTimeout(() => downloadManager.clear(downloadKey), 5000);
|
setTimeout(() => downloadManager.clear(downloadKey), 5000);
|
||||||
|
|
|
@ -28,5 +28,5 @@ export const searchNameLocal = (
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getPersonNameWithHiddenValue = derived(t, ($t) => {
|
export const getPersonNameWithHiddenValue = derived(t, ($t) => {
|
||||||
return (name: string, isHidden: boolean) => $t('person_hidden', { values: { name: name, hidden: isHidden } });
|
return (name: string, isHidden: boolean) => $t('person_hidden', { values: { name, hidden: isHidden } });
|
||||||
});
|
});
|
||||||
|
|
|
@ -107,7 +107,7 @@ export function splitBucketIntoDateGroups(bucket: AssetBucket, locale: string |
|
||||||
heightActual: false,
|
heightActual: false,
|
||||||
intersecting: false,
|
intersecting: false,
|
||||||
geometry: emptyGeometry(),
|
geometry: emptyGeometry(),
|
||||||
bucket: bucket,
|
bucket,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,7 +291,7 @@
|
||||||
const count = results.filter(({ success }) => success).length;
|
const count = results.filter(({ success }) => success).length;
|
||||||
notificationController.show({
|
notificationController.show({
|
||||||
type: NotificationType.Info,
|
type: NotificationType.Info,
|
||||||
message: $t('assets_added_count', { values: { count: count } }),
|
message: $t('assets_added_count', { values: { count } }),
|
||||||
});
|
});
|
||||||
|
|
||||||
await refreshAlbum();
|
await refreshAlbum();
|
||||||
|
|
Loading…
Reference in a new issue