mirror of
https://github.com/immich-app/immich.git
synced 2025-12-21 09:15:44 +03:00
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:
@@ -13,6 +13,7 @@ part of openapi.api;
|
||||
class UserPreferencesResponseDto {
|
||||
/// Returns a new [UserPreferencesResponseDto] instance.
|
||||
UserPreferencesResponseDto({
|
||||
required this.albums,
|
||||
required this.cast,
|
||||
required this.download,
|
||||
required this.emailNotifications,
|
||||
@@ -25,6 +26,8 @@ class UserPreferencesResponseDto {
|
||||
required this.tags,
|
||||
});
|
||||
|
||||
AlbumsResponse albums;
|
||||
|
||||
CastResponse cast;
|
||||
|
||||
DownloadResponse download;
|
||||
@@ -47,6 +50,7 @@ class UserPreferencesResponseDto {
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is UserPreferencesResponseDto &&
|
||||
other.albums == albums &&
|
||||
other.cast == cast &&
|
||||
other.download == download &&
|
||||
other.emailNotifications == emailNotifications &&
|
||||
@@ -61,6 +65,7 @@ class UserPreferencesResponseDto {
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(albums.hashCode) +
|
||||
(cast.hashCode) +
|
||||
(download.hashCode) +
|
||||
(emailNotifications.hashCode) +
|
||||
@@ -73,10 +78,11 @@ class UserPreferencesResponseDto {
|
||||
(tags.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'UserPreferencesResponseDto[cast=$cast, download=$download, emailNotifications=$emailNotifications, folders=$folders, memories=$memories, people=$people, purchase=$purchase, ratings=$ratings, sharedLinks=$sharedLinks, tags=$tags]';
|
||||
String toString() => 'UserPreferencesResponseDto[albums=$albums, 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>{};
|
||||
json[r'albums'] = this.albums;
|
||||
json[r'cast'] = this.cast;
|
||||
json[r'download'] = this.download;
|
||||
json[r'emailNotifications'] = this.emailNotifications;
|
||||
@@ -99,6 +105,7 @@ class UserPreferencesResponseDto {
|
||||
final json = value.cast<String, dynamic>();
|
||||
|
||||
return UserPreferencesResponseDto(
|
||||
albums: AlbumsResponse.fromJson(json[r'albums'])!,
|
||||
cast: CastResponse.fromJson(json[r'cast'])!,
|
||||
download: DownloadResponse.fromJson(json[r'download'])!,
|
||||
emailNotifications: EmailNotificationsResponse.fromJson(json[r'emailNotifications'])!,
|
||||
@@ -156,6 +163,7 @@ class UserPreferencesResponseDto {
|
||||
|
||||
/// The list of required keys that must be present in a JSON.
|
||||
static const requiredKeys = <String>{
|
||||
'albums',
|
||||
'cast',
|
||||
'download',
|
||||
'emailNotifications',
|
||||
|
||||
Reference in New Issue
Block a user