mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
feat(server): lighter buckets (#17831)
* feat(web): lighter timeline buckets * GalleryViewer * weird ssr * Remove generics from AssetInteraction * ensure keys on getAssetInfo, alt-text * empty - trigger ci * re-add alt-text * test fix * update tests * tests * missing import * feat(server): lighter buckets * fix: flappy e2e test * lint * revert settings * unneeded cast * fix after merge * Adapt web client to consume new server response format * test * missing import * lint * Use nulls, make-sql * openapi battle * date->string * tests * tests * lint/tests * lint * test * push aggregation to query * openapi * stack as tuple * openapi * update references to description * update alt text tests * update sql * update sql * update timeline tests * linting, fix expected response * string tuple * fix spec * fix * silly generator * rename patch * minimize sorting * review * lint * lint * sql * test * avoid abbreviations * review comment - type safety in test * merge conflicts * lint * lint/abbreviations * remove unncessary code * review comments * sql * re-add package-lock * use booleans, fix visibility in openapi spec, less cursed controller * update sql * no need to use sql template * array access actually doesn't seem to matter * remove redundant code * re-add sql decorator * unused type * remove null assertions * bad merge * Fix test * shave * extra clean shave * use decorator for content type * redundant types * redundant comment * update comment * unnecessary res --------- Co-authored-by: mertalev <101130780+mertalev@users.noreply.github.com> Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
59f666b115
commit
e7edbcdf04
41 changed files with 1109 additions and 510 deletions
|
|
@ -1,15 +1,10 @@
|
|||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
|
||||
|
||||
import { IsEnum, IsInt, IsString, Min } from 'class-validator';
|
||||
import { AssetOrder, AssetVisibility } from 'src/enum';
|
||||
import { TimeBucketSize } from 'src/repositories/asset.repository';
|
||||
import { Optional, ValidateAssetVisibility, ValidateBoolean, ValidateUUID } from 'src/validation';
|
||||
|
||||
export class TimeBucketDto {
|
||||
@IsNotEmpty()
|
||||
@IsEnum(TimeBucketSize)
|
||||
@ApiProperty({ enum: TimeBucketSize, enumName: 'TimeBucketSize' })
|
||||
size!: TimeBucketSize;
|
||||
|
||||
@ValidateUUID({ optional: true })
|
||||
userId?: string;
|
||||
|
||||
|
|
@ -46,9 +41,75 @@ export class TimeBucketDto {
|
|||
export class TimeBucketAssetDto extends TimeBucketDto {
|
||||
@IsString()
|
||||
timeBucket!: string;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Optional()
|
||||
page?: number;
|
||||
|
||||
@IsInt()
|
||||
@Min(1)
|
||||
@Optional()
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export class TimeBucketResponseDto {
|
||||
export class TimelineStackResponseDto {
|
||||
id!: string;
|
||||
primaryAssetId!: string;
|
||||
assetCount!: number;
|
||||
}
|
||||
|
||||
export class TimeBucketAssetResponseDto {
|
||||
id!: string[];
|
||||
|
||||
ownerId!: string[];
|
||||
|
||||
ratio!: number[];
|
||||
|
||||
isFavorite!: boolean[];
|
||||
|
||||
@ApiProperty({ enum: AssetVisibility, enumName: 'AssetVisibility', isArray: true })
|
||||
visibility!: AssetVisibility[];
|
||||
|
||||
isTrashed!: boolean[];
|
||||
|
||||
isImage!: boolean[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
thumbhash!: (string | null)[];
|
||||
|
||||
localDateTime!: string[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
duration!: (string | null)[];
|
||||
|
||||
@ApiProperty({
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'array',
|
||||
items: { type: 'string' },
|
||||
minItems: 2,
|
||||
maxItems: 2,
|
||||
nullable: true,
|
||||
},
|
||||
description: '(stack ID, stack asset count) tuple',
|
||||
})
|
||||
stack?: ([string, string] | null)[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
projectionType!: (string | null)[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
livePhotoVideoId!: (string | null)[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
city!: (string | null)[];
|
||||
|
||||
@ApiProperty({ type: 'array', items: { type: 'string', nullable: true } })
|
||||
country!: (string | null)[];
|
||||
}
|
||||
|
||||
export class TimeBucketsResponseDto {
|
||||
@ApiProperty({ type: 'string' })
|
||||
timeBucket!: string;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue