mirror of
https://github.com/immich-app/immich
synced 2025-10-17 18:19:27 +00:00
feat: user preferences for archive download size (#10296)
* feat: user preferences for archive download size * chore: open api * chore: clean up --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
parent
596412cb8f
commit
dddc06c3b2
19 changed files with 442 additions and 24 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsEnum, ValidateNested } from 'class-validator';
|
||||
import { IsEnum, IsInt, IsPositive, ValidateNested } from 'class-validator';
|
||||
import { UserAvatarColor, UserPreferences } from 'src/entities/user-metadata.entity';
|
||||
import { Optional, ValidateBoolean } from 'src/validation';
|
||||
|
||||
|
|
@ -27,6 +27,14 @@ class EmailNotificationsUpdate {
|
|||
albumUpdate?: boolean;
|
||||
}
|
||||
|
||||
class DownloadUpdate {
|
||||
@Optional()
|
||||
@IsInt()
|
||||
@IsPositive()
|
||||
@ApiProperty({ type: 'integer' })
|
||||
archiveSize?: number;
|
||||
}
|
||||
|
||||
export class UserPreferencesUpdateDto {
|
||||
@Optional()
|
||||
@ValidateNested()
|
||||
|
|
@ -42,6 +50,11 @@ export class UserPreferencesUpdateDto {
|
|||
@ValidateNested()
|
||||
@Type(() => EmailNotificationsUpdate)
|
||||
emailNotifications?: EmailNotificationsUpdate;
|
||||
|
||||
@Optional()
|
||||
@ValidateNested()
|
||||
@Type(() => DownloadUpdate)
|
||||
download?: DownloadUpdate;
|
||||
}
|
||||
|
||||
class AvatarResponse {
|
||||
|
|
@ -59,10 +72,16 @@ class EmailNotificationsResponse {
|
|||
albumUpdate!: boolean;
|
||||
}
|
||||
|
||||
class DownloadResponse {
|
||||
@ApiProperty({ type: 'integer' })
|
||||
archiveSize!: number;
|
||||
}
|
||||
|
||||
export class UserPreferencesResponseDto implements UserPreferences {
|
||||
memories!: MemoryResponse;
|
||||
avatar!: AvatarResponse;
|
||||
emailNotifications!: EmailNotificationsResponse;
|
||||
download!: DownloadResponse;
|
||||
}
|
||||
|
||||
export const mapPreferences = (preferences: UserPreferences): UserPreferencesResponseDto => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue