mirror of
https://github.com/Poniverse/Pony.fm.git
synced 2025-03-29 14:27:46 +01:00
Fixes #56: no more duplicate tracks when browsing!
This commit is contained in:
parent
5314f5accb
commit
20ef64988a
1 changed files with 3 additions and 0 deletions
|
@ -224,6 +224,9 @@ class TracksController extends ApiControllerBase
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Input::has('songs')) {
|
if (Input::has('songs')) {
|
||||||
|
// DISTINCT is needed here to avoid duplicate results
|
||||||
|
// when a track is associated with multiple show songs.
|
||||||
|
$query->distinct();
|
||||||
$query->join('show_song_track', function ($join) {
|
$query->join('show_song_track', function ($join) {
|
||||||
$join->on('tracks.id', '=', 'show_song_track.track_id');
|
$join->on('tracks.id', '=', 'show_song_track.track_id');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue