mirror of
https://github.com/apricote/Listory.git
synced 2026-01-13 21:21:02 +00:00
fix(api): album&track reports only contain one artist
Albums & Tracks can have multiple artists associated with them, but the previous SQL queries would only return a randomly-chosen one of them.
This commit is contained in:
parent
0cb2173349
commit
471f46eb8d
1 changed files with 2 additions and 2 deletions
|
|
@ -152,7 +152,7 @@ export class ReportsService {
|
|||
.leftJoinAndSelect("listen.track", "track")
|
||||
.leftJoinAndSelect("track.album", "album")
|
||||
.leftJoinAndSelect("album.artists", "artists")
|
||||
.distinctOn(["album.id"])
|
||||
.distinctOn(["album.id", "artists.id"])
|
||||
.getMany(),
|
||||
]);
|
||||
|
||||
|
|
@ -189,7 +189,7 @@ export class ReportsService {
|
|||
this.getListensQueryFromOptions(options)
|
||||
.leftJoinAndSelect("listen.track", "track")
|
||||
.leftJoinAndSelect("track.artists", "artists")
|
||||
.distinctOn(["track.id"])
|
||||
.distinctOn(["track.id", "artists.id"])
|
||||
.getMany(),
|
||||
]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue