mirror of
https://github.com/apricote/Listory.git
synced 2026-02-06 17:57:03 +00:00
feat: add top-artists report
This commit is contained in:
parent
6a6ba493f6
commit
6fc10c40ca
18 changed files with 345 additions and 30 deletions
18
src/reports/dto/get-top-artists-report.dto.ts
Normal file
18
src/reports/dto/get-top-artists-report.dto.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import { IsEnum, IsISO8601, ValidateIf } from "class-validator";
|
||||
import { User } from "../../users/user.entity";
|
||||
import { TimePreset } from "../timePreset.enum";
|
||||
|
||||
export class GetTopArtistsReportDto {
|
||||
user: User;
|
||||
|
||||
@IsEnum(TimePreset)
|
||||
timePreset: TimePreset;
|
||||
|
||||
@ValidateIf((o) => o.timePreset === TimePreset.CUSTOM)
|
||||
@IsISO8601()
|
||||
customTimeStart: string;
|
||||
|
||||
@ValidateIf((o) => o.timePreset === TimePreset.CUSTOM)
|
||||
@IsISO8601()
|
||||
customTimeEnd: string;
|
||||
}
|
||||
8
src/reports/dto/top-artists-report.dto.ts
Normal file
8
src/reports/dto/top-artists-report.dto.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { Artist } from "../../music-library/artist.entity";
|
||||
|
||||
export class TopArtistsReportDto {
|
||||
items: {
|
||||
artist: Artist;
|
||||
count: number;
|
||||
}[];
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue