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:
Daniel Dietzler 2024-06-14 17:27:12 +02:00 committed by GitHub
parent 596412cb8f
commit dddc06c3b2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 442 additions and 24 deletions

View file

@ -1,4 +1,5 @@
import { UserEntity } from 'src/entities/user.entity';
import { HumanReadableSize } from 'src/utils/bytes';
import { Column, DeepPartial, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
@Entity('user_metadata')
@ -41,6 +42,9 @@ export interface UserPreferences {
albumInvite: boolean;
albumUpdate: boolean;
};
download: {
archiveSize: number;
};
}
export const getDefaultPreferences = (user: { email: string }): UserPreferences => {
@ -61,6 +65,9 @@ export const getDefaultPreferences = (user: { email: string }): UserPreferences
albumInvite: true,
albumUpdate: true,
},
download: {
archiveSize: HumanReadableSize.GiB * 4,
},
};
};