mirror of
https://github.com/apricote/Listory.git
synced 2026-02-06 17:57:03 +00:00
feat: add top tracks report
This commit is contained in:
parent
60dc25f15e
commit
51fd78f6d9
11 changed files with 230 additions and 0 deletions
|
|
@ -6,6 +6,7 @@ import { ListenReportDto } from "./dto/listen-report.dto";
|
|||
import { ReportTimeDto } from "./dto/report-time.dto";
|
||||
import { TopAlbumsReportDto } from "./dto/top-albums-report.dto";
|
||||
import { TopArtistsReportDto } from "./dto/top-artists-report.dto";
|
||||
import { TopTracksReportDto } from "./dto/top-tracks-report.dto";
|
||||
import { ReportsService } from "./reports.service";
|
||||
import { Timeframe } from "./timeframe.enum";
|
||||
|
||||
|
|
@ -40,4 +41,13 @@ export class ReportsController {
|
|||
): Promise<TopAlbumsReportDto> {
|
||||
return this.reportsService.getTopAlbums({ user, time });
|
||||
}
|
||||
|
||||
@Get("top-tracks")
|
||||
@AuthAccessToken()
|
||||
async getTopTracks(
|
||||
@Query() time: ReportTimeDto,
|
||||
@ReqUser() user: User
|
||||
): Promise<TopTracksReportDto> {
|
||||
return this.reportsService.getTopTracks({ user, time });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue