mirror of
https://github.com/immich-app/immich.git
synced 2024-11-24 08:52:28 +02:00
chore(server): remove unused property (#9521)
This commit is contained in:
parent
581b467b4b
commit
73bf8f343a
BIN
mobile/openapi/doc/CreateLibraryDto.md
generated
BIN
mobile/openapi/doc/CreateLibraryDto.md
generated
Binary file not shown.
BIN
mobile/openapi/doc/UpdateLibraryDto.md
generated
BIN
mobile/openapi/doc/UpdateLibraryDto.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/create_library_dto.dart
generated
BIN
mobile/openapi/lib/model/create_library_dto.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/update_library_dto.dart
generated
BIN
mobile/openapi/lib/model/update_library_dto.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/create_library_dto_test.dart
generated
BIN
mobile/openapi/test/create_library_dto_test.dart
generated
Binary file not shown.
BIN
mobile/openapi/test/update_library_dto_test.dart
generated
BIN
mobile/openapi/test/update_library_dto_test.dart
generated
Binary file not shown.
@ -7708,9 +7708,6 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"isVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
@ -10741,9 +10738,6 @@
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"isVisible": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
}
|
||||
|
@ -442,7 +442,6 @@ export type LibraryResponseDto = {
|
||||
export type CreateLibraryDto = {
|
||||
exclusionPatterns?: string[];
|
||||
importPaths?: string[];
|
||||
isVisible?: boolean;
|
||||
name?: string;
|
||||
ownerId: string;
|
||||
"type": LibraryType;
|
||||
@ -450,7 +449,6 @@ export type CreateLibraryDto = {
|
||||
export type UpdateLibraryDto = {
|
||||
exclusionPatterns?: string[];
|
||||
importPaths?: string[];
|
||||
isVisible?: boolean;
|
||||
name?: string;
|
||||
};
|
||||
export type ScanLibraryDto = {
|
||||
|
@ -101,7 +101,6 @@ export class UserCore {
|
||||
type: LibraryType.UPLOAD,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
});
|
||||
|
||||
return userEntity;
|
||||
|
@ -16,9 +16,6 @@ export class CreateLibraryDto {
|
||||
@IsNotEmpty()
|
||||
name?: string;
|
||||
|
||||
@ValidateBoolean({ optional: true })
|
||||
isVisible?: boolean;
|
||||
|
||||
@Optional()
|
||||
@IsString({ each: true })
|
||||
@IsNotEmpty({ each: true })
|
||||
@ -40,9 +37,6 @@ export class UpdateLibraryDto {
|
||||
@IsNotEmpty()
|
||||
name?: string;
|
||||
|
||||
@ValidateBoolean({ optional: true })
|
||||
isVisible?: boolean;
|
||||
|
||||
@Optional()
|
||||
@IsString({ each: true })
|
||||
@IsNotEmpty({ each: true })
|
||||
|
@ -50,9 +50,6 @@ export class LibraryEntity {
|
||||
|
||||
@Column({ type: 'timestamptz', nullable: true })
|
||||
refreshedAt!: Date | null;
|
||||
|
||||
@Column({ type: 'boolean', default: true })
|
||||
isVisible!: boolean;
|
||||
}
|
||||
|
||||
export enum LibraryType {
|
||||
|
@ -0,0 +1,14 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class RemoveLibraryIsVisible1715798702876 implements MigrationInterface {
|
||||
name = 'RemoveLibraryIsVisible1715798702876'
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "libraries" DROP COLUMN "isVisible"`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`ALTER TABLE "libraries" ADD "isVisible" boolean NOT NULL DEFAULT true`);
|
||||
}
|
||||
|
||||
}
|
@ -16,7 +16,6 @@ FROM
|
||||
"LibraryEntity"."updatedAt" AS "LibraryEntity_updatedAt",
|
||||
"LibraryEntity"."deletedAt" AS "LibraryEntity_deletedAt",
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt",
|
||||
"LibraryEntity"."isVisible" AS "LibraryEntity_isVisible",
|
||||
"LibraryEntity__LibraryEntity_owner"."id" AS "LibraryEntity__LibraryEntity_owner_id",
|
||||
"LibraryEntity__LibraryEntity_owner"."name" AS "LibraryEntity__LibraryEntity_owner_name",
|
||||
"LibraryEntity__LibraryEntity_owner"."avatarColor" AS "LibraryEntity__LibraryEntity_owner_avatarColor",
|
||||
@ -89,8 +88,7 @@ SELECT
|
||||
"LibraryEntity"."createdAt" AS "LibraryEntity_createdAt",
|
||||
"LibraryEntity"."updatedAt" AS "LibraryEntity_updatedAt",
|
||||
"LibraryEntity"."deletedAt" AS "LibraryEntity_deletedAt",
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt",
|
||||
"LibraryEntity"."isVisible" AS "LibraryEntity_isVisible"
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt"
|
||||
FROM
|
||||
"libraries" "LibraryEntity"
|
||||
WHERE
|
||||
@ -132,7 +130,6 @@ SELECT
|
||||
"LibraryEntity"."updatedAt" AS "LibraryEntity_updatedAt",
|
||||
"LibraryEntity"."deletedAt" AS "LibraryEntity_deletedAt",
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt",
|
||||
"LibraryEntity"."isVisible" AS "LibraryEntity_isVisible",
|
||||
"LibraryEntity__LibraryEntity_owner"."id" AS "LibraryEntity__LibraryEntity_owner_id",
|
||||
"LibraryEntity__LibraryEntity_owner"."name" AS "LibraryEntity__LibraryEntity_owner_name",
|
||||
"LibraryEntity__LibraryEntity_owner"."avatarColor" AS "LibraryEntity__LibraryEntity_owner_avatarColor",
|
||||
@ -156,12 +153,7 @@ FROM
|
||||
"LibraryEntity__LibraryEntity_owner"."deletedAt" IS NULL
|
||||
)
|
||||
WHERE
|
||||
(
|
||||
(
|
||||
("LibraryEntity"."ownerId" = $1)
|
||||
AND ("LibraryEntity"."isVisible" = $2)
|
||||
)
|
||||
)
|
||||
((("LibraryEntity"."ownerId" = $1)))
|
||||
AND ("LibraryEntity"."deletedAt" IS NULL)
|
||||
ORDER BY
|
||||
"LibraryEntity"."createdAt" ASC
|
||||
@ -178,7 +170,6 @@ SELECT
|
||||
"LibraryEntity"."updatedAt" AS "LibraryEntity_updatedAt",
|
||||
"LibraryEntity"."deletedAt" AS "LibraryEntity_deletedAt",
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt",
|
||||
"LibraryEntity"."isVisible" AS "LibraryEntity_isVisible",
|
||||
"LibraryEntity__LibraryEntity_owner"."id" AS "LibraryEntity__LibraryEntity_owner_id",
|
||||
"LibraryEntity__LibraryEntity_owner"."name" AS "LibraryEntity__LibraryEntity_owner_name",
|
||||
"LibraryEntity__LibraryEntity_owner"."avatarColor" AS "LibraryEntity__LibraryEntity_owner_avatarColor",
|
||||
@ -218,7 +209,6 @@ SELECT
|
||||
"LibraryEntity"."updatedAt" AS "LibraryEntity_updatedAt",
|
||||
"LibraryEntity"."deletedAt" AS "LibraryEntity_deletedAt",
|
||||
"LibraryEntity"."refreshedAt" AS "LibraryEntity_refreshedAt",
|
||||
"LibraryEntity"."isVisible" AS "LibraryEntity_isVisible",
|
||||
"LibraryEntity__LibraryEntity_owner"."id" AS "LibraryEntity__LibraryEntity_owner_id",
|
||||
"LibraryEntity__LibraryEntity_owner"."name" AS "LibraryEntity__LibraryEntity_owner_name",
|
||||
"LibraryEntity__LibraryEntity_owner"."avatarColor" AS "LibraryEntity__LibraryEntity_owner_avatarColor",
|
||||
@ -239,10 +229,7 @@ FROM
|
||||
"libraries" "LibraryEntity"
|
||||
LEFT JOIN "users" "LibraryEntity__LibraryEntity_owner" ON "LibraryEntity__LibraryEntity_owner"."id" = "LibraryEntity"."ownerId"
|
||||
WHERE
|
||||
(
|
||||
("LibraryEntity"."isVisible" = $1)
|
||||
AND (NOT ("LibraryEntity"."deletedAt" IS NULL))
|
||||
)
|
||||
((NOT ("LibraryEntity"."deletedAt" IS NULL)))
|
||||
ORDER BY
|
||||
"LibraryEntity"."createdAt" ASC
|
||||
|
||||
@ -258,7 +245,6 @@ SELECT
|
||||
"libraries"."updatedAt" AS "libraries_updatedAt",
|
||||
"libraries"."deletedAt" AS "libraries_deletedAt",
|
||||
"libraries"."refreshedAt" AS "libraries_refreshedAt",
|
||||
"libraries"."isVisible" AS "libraries_isVisible",
|
||||
COUNT("assets"."id") FILTER (
|
||||
WHERE
|
||||
"assets"."type" = 'IMAGE'
|
||||
|
@ -67,7 +67,6 @@ export class LibraryRepository implements ILibraryRepository {
|
||||
return this.repository.find({
|
||||
where: {
|
||||
ownerId,
|
||||
isVisible: true,
|
||||
type,
|
||||
},
|
||||
relations: {
|
||||
@ -97,7 +96,6 @@ export class LibraryRepository implements ILibraryRepository {
|
||||
getAllDeleted(): Promise<LibraryEntity[]> {
|
||||
return this.repository.find({
|
||||
where: {
|
||||
isVisible: true,
|
||||
deletedAt: Not(IsNull()),
|
||||
},
|
||||
relations: {
|
||||
|
@ -259,7 +259,6 @@ export class AssetServiceV1 {
|
||||
type: LibraryType.UPLOAD,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -830,7 +830,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.EXTERNAL,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@ -860,37 +859,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.EXTERNAL,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
||||
it('should create invisible', async () => {
|
||||
libraryMock.create.mockResolvedValue(libraryStub.externalLibrary1);
|
||||
await expect(
|
||||
sut.create({ ownerId: authStub.admin.user.id, type: LibraryType.EXTERNAL, isVisible: false }),
|
||||
).resolves.toEqual(
|
||||
expect.objectContaining({
|
||||
id: libraryStub.externalLibrary1.id,
|
||||
type: LibraryType.EXTERNAL,
|
||||
name: libraryStub.externalLibrary1.name,
|
||||
ownerId: libraryStub.externalLibrary1.ownerId,
|
||||
assetCount: 0,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
createdAt: libraryStub.externalLibrary1.createdAt,
|
||||
updatedAt: libraryStub.externalLibrary1.updatedAt,
|
||||
refreshedAt: null,
|
||||
}),
|
||||
);
|
||||
|
||||
expect(libraryMock.create).toHaveBeenCalledWith(
|
||||
expect.objectContaining({
|
||||
name: expect.any(String),
|
||||
type: LibraryType.EXTERNAL,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: false,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@ -924,7 +892,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.EXTERNAL,
|
||||
importPaths: ['/data/images', '/data/videos'],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@ -972,7 +939,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.EXTERNAL,
|
||||
importPaths: [],
|
||||
exclusionPatterns: ['*.tmp', '*.bak'],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@ -1002,7 +968,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.UPLOAD,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
@ -1032,7 +997,6 @@ describe(LibraryService.name, () => {
|
||||
type: LibraryType.UPLOAD,
|
||||
importPaths: [],
|
||||
exclusionPatterns: [],
|
||||
isVisible: true,
|
||||
}),
|
||||
);
|
||||
});
|
||||
|
@ -271,7 +271,6 @@ export class LibraryService {
|
||||
type: dto.type,
|
||||
importPaths: dto.importPaths ?? [],
|
||||
exclusionPatterns: dto.exclusionPatterns ?? [],
|
||||
isVisible: dto.isVisible ?? true,
|
||||
});
|
||||
|
||||
this.logger.log(`Creating ${dto.type} library for ${dto.ownerId}}`);
|
||||
|
8
server/test/fixtures/library.stub.ts
vendored
8
server/test/fixtures/library.stub.ts
vendored
@ -16,7 +16,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2022-01-01'),
|
||||
updatedAt: new Date('2022-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: [],
|
||||
}),
|
||||
externalLibrary1: Object.freeze<LibraryEntity>({
|
||||
@ -30,7 +29,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: [],
|
||||
}),
|
||||
externalLibrary2: Object.freeze<LibraryEntity>({
|
||||
@ -44,7 +42,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2021-01-01'),
|
||||
updatedAt: new Date('2022-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: [],
|
||||
}),
|
||||
externalLibraryWithImportPaths1: Object.freeze<LibraryEntity>({
|
||||
@ -58,7 +55,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: [],
|
||||
}),
|
||||
externalLibraryWithImportPaths2: Object.freeze<LibraryEntity>({
|
||||
@ -72,7 +68,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: [],
|
||||
}),
|
||||
externalLibraryWithExclusionPattern: Object.freeze<LibraryEntity>({
|
||||
@ -86,7 +81,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: ['**/dir1/**'],
|
||||
}),
|
||||
patternPath: Object.freeze<LibraryEntity>({
|
||||
@ -100,7 +94,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: ['**/dir1/**'],
|
||||
}),
|
||||
hasImmichPaths: Object.freeze<LibraryEntity>({
|
||||
@ -114,7 +107,6 @@ export const libraryStub = {
|
||||
createdAt: new Date('2023-01-01'),
|
||||
updatedAt: new Date('2023-01-01'),
|
||||
refreshedAt: null,
|
||||
isVisible: true,
|
||||
exclusionPatterns: ['**/dir1/**'],
|
||||
}),
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user