feat(web): add a user setting for default album sort order. (#18950)

* Add a user setting for default album sort order.

Add a user setting under "Features" to control the initial sort order
when creating an album. Default to the existing behavior of
"newest first".

* chore: patch openapi

---------

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Dag Stuan 2025-06-06 06:31:34 +02:00 committed by GitHub
parent 55f4e93456
commit b46e066cc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 397 additions and 13 deletions

View file

@ -13,6 +13,7 @@ part of openapi.api;
class UserPreferencesUpdateDto {
/// Returns a new [UserPreferencesUpdateDto] instance.
UserPreferencesUpdateDto({
this.albums,
this.avatar,
this.cast,
this.download,
@ -26,6 +27,14 @@ class UserPreferencesUpdateDto {
this.tags,
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
AlbumsUpdate? albums;
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
@ -116,6 +125,7 @@ class UserPreferencesUpdateDto {
@override
bool operator ==(Object other) => identical(this, other) || other is UserPreferencesUpdateDto &&
other.albums == albums &&
other.avatar == avatar &&
other.cast == cast &&
other.download == download &&
@ -131,6 +141,7 @@ class UserPreferencesUpdateDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(albums == null ? 0 : albums!.hashCode) +
(avatar == null ? 0 : avatar!.hashCode) +
(cast == null ? 0 : cast!.hashCode) +
(download == null ? 0 : download!.hashCode) +
@ -144,10 +155,15 @@ class UserPreferencesUpdateDto {
(tags == null ? 0 : tags!.hashCode);
@override
String toString() => 'UserPreferencesUpdateDto[avatar=$avatar, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]';
String toString() => 'UserPreferencesUpdateDto[albums=$albums, avatar=$avatar, cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.albums != null) {
json[r'albums'] = this.albums;
} else {
// json[r'albums'] = null;
}
if (this.avatar != null) {
json[r'avatar'] = this.avatar;
} else {
@ -215,6 +231,7 @@ class UserPreferencesUpdateDto {
final json = value.cast<String, dynamic>();
return UserPreferencesUpdateDto(
albums: AlbumsUpdate.fromJson(json[r'albums']),
avatar: AvatarUpdate.fromJson(json[r'avatar']),
cast: CastUpdate.fromJson(json[r'cast']),
download: DownloadUpdate.fromJson(json[r'download']),