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

Option to disable readonly status of external libraries #9188

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
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: 1 addition & 0 deletions mobile/openapi/doc/CreateLibraryDto.md

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

1 change: 1 addition & 0 deletions mobile/openapi/doc/LibraryResponseDto.md

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

1 change: 1 addition & 0 deletions mobile/openapi/doc/UpdateLibraryDto.md

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

19 changes: 18 additions & 1 deletion 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.

10 changes: 9 additions & 1 deletion mobile/openapi/lib/model/library_response_dto.dart

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

19 changes: 18 additions & 1 deletion 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: 5 additions & 0 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: 5 additions & 0 deletions mobile/openapi/test/library_response_dto_test.dart

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

5 changes: 5 additions & 0 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.

10 changes: 10 additions & 0 deletions open-api/immich-openapi-specs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7681,6 +7681,9 @@
},
"type": "array"
},
"isReadOnly": {
"type": "boolean"
},
"isVisible": {
"type": "boolean"
},
Expand Down Expand Up @@ -8200,6 +8203,9 @@
},
"type": "array"
},
"isReadOnly": {
"type": "boolean"
},
"name": {
"type": "string"
},
Expand All @@ -8225,6 +8231,7 @@
"exclusionPatterns",
"id",
"importPaths",
"isReadOnly",
"name",
"ownerId",
"refreshedAt",
Expand Down Expand Up @@ -10647,6 +10654,9 @@
},
"type": "array"
},
"isReadOnly": {
"type": "boolean"
},
"isVisible": {
"type": "boolean"
},
Expand Down
3 changes: 3 additions & 0 deletions open-api/typescript-sdk/src/fetch-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ export type LibraryResponseDto = {
exclusionPatterns: string[];
id: string;
importPaths: string[];
isReadOnly: boolean;
name: string;
ownerId: string;
refreshedAt: string | null;
Expand All @@ -433,6 +434,7 @@ export type LibraryResponseDto = {
export type CreateLibraryDto = {
exclusionPatterns?: string[];
importPaths?: string[];
isReadOnly?: boolean;
isVisible?: boolean;
name?: string;
ownerId: string;
Expand All @@ -441,6 +443,7 @@ export type CreateLibraryDto = {
export type UpdateLibraryDto = {
exclusionPatterns?: string[];
importPaths?: string[];
isReadOnly?: boolean;
isVisible?: boolean;
name?: string;
};
Expand Down
1 change: 1 addition & 0 deletions server/src/cores/user.core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export class UserCore {
type: LibraryType.UPLOAD,
importPaths: [],
exclusionPatterns: [],
isReadOnly: false,
isVisible: true,
});

Expand Down
9 changes: 9 additions & 0 deletions server/src/dtos/library.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export class CreateLibraryDto {
@ValidateBoolean({ optional: true })
isVisible?: boolean;

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

@Optional()
@IsString({ each: true })
@IsNotEmpty({ each: true })
Expand All @@ -43,6 +46,9 @@ export class UpdateLibraryDto {
@ValidateBoolean({ optional: true })
isVisible?: boolean;

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

@Optional()
@IsString({ each: true })
@IsNotEmpty({ each: true })
Expand Down Expand Up @@ -128,6 +134,8 @@ export class LibraryResponseDto {
createdAt!: Date;
updatedAt!: Date;
refreshedAt!: Date | null;

isReadOnly!: boolean;
}

export class LibraryStatsResponseDto {
Expand Down Expand Up @@ -160,5 +168,6 @@ export function mapLibrary(entity: LibraryEntity): LibraryResponseDto {
assetCount,
importPaths: entity.importPaths,
exclusionPatterns: entity.exclusionPatterns,
isReadOnly: entity.isReadOnly,
};
}
3 changes: 3 additions & 0 deletions server/src/entities/library.entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ export class LibraryEntity {

@Column({ type: 'boolean', default: true })
isVisible!: boolean;

@Column({ type: 'boolean', default: false })
isReadOnly!: boolean;
}

export enum LibraryType {
Expand Down
Loading
Loading