Skip to content

Commit

Permalink
chore(server): remove unused property
Browse files Browse the repository at this point in the history
  • Loading branch information
jrasm91 committed May 15, 2024
1 parent 581b467 commit f9124d1
Show file tree
Hide file tree
Showing 16 changed files with 2 additions and 114 deletions.
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
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
36 changes: 0 additions & 36 deletions server/src/services/library.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,6 @@ describe(LibraryService.name, () => {
type: LibraryType.EXTERNAL,
importPaths: [],
exclusionPatterns: [],
isVisible: true,
}),
);
});
Expand Down Expand Up @@ -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,
}),
);
});
Expand Down Expand Up @@ -924,7 +892,6 @@ describe(LibraryService.name, () => {
type: LibraryType.EXTERNAL,
importPaths: ['/data/images', '/data/videos'],
exclusionPatterns: [],
isVisible: true,
}),
);
});
Expand Down Expand Up @@ -972,7 +939,6 @@ describe(LibraryService.name, () => {
type: LibraryType.EXTERNAL,
importPaths: [],
exclusionPatterns: ['*.tmp', '*.bak'],
isVisible: true,
}),
);
});
Expand Down Expand Up @@ -1002,7 +968,6 @@ describe(LibraryService.name, () => {
type: LibraryType.UPLOAD,
importPaths: [],
exclusionPatterns: [],
isVisible: true,
}),
);
});
Expand Down Expand Up @@ -1032,7 +997,6 @@ describe(LibraryService.name, () => {
type: LibraryType.UPLOAD,
importPaths: [],
exclusionPatterns: [],
isVisible: true,
}),
);
});
Expand Down
1 change: 0 additions & 1 deletion server/src/services/library.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}}`);
Expand Down
Loading

0 comments on commit f9124d1

Please sign in to comment.