mirror of
https://github.com/immich-app/immich.git
synced 2024-11-28 09:33:27 +02:00
feat(server): sort images in duplicate groups by date (#12094)
* feat(server): sort images in duplicate groups by date * Update server/src/dtos/duplicate.dto.ts Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com> --------- Co-authored-by: Alex <alex.tran1502@gmail.com> Co-authored-by: Daniel Dietzler <36593685+danieldietzler@users.noreply.github.com>
This commit is contained in:
parent
363c558db7
commit
562fec6e2b
@ -1,5 +1,5 @@
|
||||
import { IsNotEmpty } from 'class-validator';
|
||||
import { groupBy } from 'lodash';
|
||||
import { groupBy, sortBy } from 'lodash';
|
||||
import { AssetResponseDto } from 'src/dtos/asset-response.dto';
|
||||
import { ValidateUUID } from 'src/validation';
|
||||
|
||||
@ -19,7 +19,8 @@ export function mapDuplicateResponse(assets: AssetResponseDto[]): DuplicateRespo
|
||||
|
||||
const grouped = groupBy(assets, (a) => a.duplicateId);
|
||||
|
||||
for (const [duplicateId, assets] of Object.entries(grouped)) {
|
||||
for (const [duplicateId, unsortedAssets] of Object.entries(grouped)) {
|
||||
const assets = sortBy(unsortedAssets, (asset) => asset.localDateTime);
|
||||
result.push({ duplicateId, assets });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user