Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(server): remove unused property #9521

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion mobile/openapi/doc/CreateLibraryDto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion mobile/openapi/doc/UpdateLibraryDto.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions mobile/openapi/lib/model/create_library_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 1 addition & 18 deletions mobile/openapi/lib/model/update_library_dto.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions mobile/openapi/test/create_library_dto_test.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 0 additions & 5 deletions mobile/openapi/test/update_library_dto_test.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7708,9 +7708,6 @@
},
"type": "array"
},
"isVisible": {
"type": "boolean"
},
"name": {
"type": "string"
},
Expand Down Expand Up @@ -10741,9 +10738,6 @@
},
"type": "array"
},
"isVisible": {
"type": "boolean"
},
"name": {
"type": "string"
}
Expand Down
2 changes: 0 additions & 2 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,13 @@ export type LibraryResponseDto = {
export type CreateLibraryDto = {
exclusionPatterns?: string[];
importPaths?: string[];
isVisible?: boolean;
name?: string;
ownerId: string;
"type": LibraryType;
};
export type UpdateLibraryDto = {
exclusionPatterns?: string[];
importPaths?: string[];
isVisible?: boolean;
name?: string;
};
export type ScanLibraryDto = {
Expand Down
1 change: 0 additions & 1 deletion server/src/cores/user.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ export class UserCore {
type: LibraryType.UPLOAD,
importPaths: [],
exclusionPatterns: [],
isVisible: true,
});

return userEntity;
Expand Down
6 changes: 0 additions & 6 deletions server/src/dtos/library.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ export class CreateLibraryDto {
@IsNotEmpty()
name?: string;

@ValidateBoolean({ optional: true })
isVisible?: boolean;

@Optional()
@IsString({ each: true })
@IsNotEmpty({ each: true })
Expand All @@ -40,9 +37,6 @@ export class UpdateLibraryDto {
@IsNotEmpty()
name?: string;

@ValidateBoolean({ optional: true })
isVisible?: boolean;

@Optional()
@IsString({ each: true })
@IsNotEmpty({ each: true })
Expand Down
3 changes: 0 additions & 3 deletions server/src/entities/library.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
14 changes: 14 additions & 0 deletions server/src/migrations/1715798702876-RemoveLibraryIsVisible.ts
Original file line number Diff line number Diff line change
@@ -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`);
}

}
20 changes: 3 additions & 17 deletions server/src/queries/library.repository.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand All @@ -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
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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

Expand All @@ -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'
Expand Down
2 changes: 0 additions & 2 deletions server/src/repositories/library.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ export class LibraryRepository implements ILibraryRepository {
return this.repository.find({
where: {
ownerId,
isVisible: true,
type,
},
relations: {
Expand Down Expand Up @@ -97,7 +96,6 @@ export class LibraryRepository implements ILibraryRepository {
getAllDeleted(): Promise<LibraryEntity[]> {
return this.repository.find({
where: {
isVisible: true,
deletedAt: Not(IsNull()),
},
relations: {
Expand Down
1 change: 0 additions & 1 deletion server/src/services/asset-v1.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ export class AssetServiceV1 {
type: LibraryType.UPLOAD,
importPaths: [],
exclusionPatterns: [],
isVisible: true,
});
}

Expand Down
Loading
Loading