-
-
Save myndzi/4b986ec64c21d0cb8ab3756283b008ae to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var qb = knex.select('songs.id', 'songs.name AS song', 'artists.name AS artist', 'songs.path', 'albums.name AS album') | |
.from('songs') | |
.join('genreAssociation', 'songs.id', 'genreAssociation.id_songs') | |
.join('artists', 'songs.id_artists', 'artists.id') | |
.join('albums', 'songs.id_albums', 'albums.id') | |
.where('genreAssociation.id', req.params.id) | |
if (req.session.playedSongs && req.session.playedSongs.length != 0 && req.session.playedSongs != []) { | |
qb.whereNotIn('songs.id', req.session.playedSongs); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment