mirror of
https://github.com/immich-app/immich.git
synced 2026-03-26 03:28:59 +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:
@@ -19,6 +19,7 @@ import { Permission } from 'src/enum';
|
||||
import { AlbumAssetCount, AlbumInfoOptions } from 'src/repositories/album.repository';
|
||||
import { BaseService } from 'src/services/base.service';
|
||||
import { addAssets, removeAssets } from 'src/utils/asset.util';
|
||||
import { getPreferences } from 'src/utils/preferences';
|
||||
|
||||
@Injectable()
|
||||
export class AlbumService extends BaseService {
|
||||
@@ -106,12 +107,15 @@ export class AlbumService extends BaseService {
|
||||
});
|
||||
const assetIds = [...allowedAssetIdsSet].map((id) => id);
|
||||
|
||||
const userMetadata = await this.userRepository.getMetadata(auth.user.id);
|
||||
|
||||
const album = await this.albumRepository.create(
|
||||
{
|
||||
ownerId: auth.user.id,
|
||||
albumName: dto.albumName,
|
||||
description: dto.description,
|
||||
albumThumbnailAssetId: assetIds[0] || null,
|
||||
order: getPreferences(userMetadata).albums.defaultAssetOrder,
|
||||
},
|
||||
assetIds,
|
||||
albumUsers,
|
||||
|
||||
Reference in New Issue
Block a user