Fixes #56: no more duplicate tracks when browsing!

This commit is contained in:
Peter Deltchev 2016-02-15 08:02:44 -08:00
parent 5314f5accb
commit 20ef64988a

View file

@ -224,6 +224,9 @@ class TracksController extends ApiControllerBase
}
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) {
$join->on('tracks.id', '=', 'show_song_track.track_id');
});