Commit 75af6e0a authored by Camilo Higuita's avatar Camilo Higuita

option to save whole lists to playlist

parent 3ef5eaa2
......@@ -17,7 +17,7 @@ var GET = {
favoriteTracks : "select t.*, al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist where stars > 0 order by stars desc limit 100",
recentTracks: "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist order by strftime(\"%s\", addDate) desc LIMIT 100",
babedTracks: "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist where t.babe = 1",
playlistTracks_ : "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist inner join tracks_playlists pl on pl.url = t.url where pl.playlist = \"%1\" order by strftime(\"%s\", addDate) desc",
playlistTracks_ : "select t.* , al.artwork from tracks t inner join albums al on t.album = al.album and t.artist = al.artist inner join tracks_playlists pl on pl.url = t.url where pl.playlist = \"%1\" order by strftime(\"%s\", pl.addDate) desc",
......
......@@ -109,22 +109,7 @@ BabeList
{
id: headerMenu
onSaveListClicked:
{
console.log(list.count)
if (count > 0)
for(var i in count)
{
var url = listModel.get(i).url
console.log(url)
playlistDialog.tracks.push(url)
}
playlistDialog.open()
}
onSaveListClicked: saveList()
}
TableMenu
......@@ -187,5 +172,18 @@ BabeList
list.rowPressed(index)
}
function saveList()
{
var trackList = []
for(var i = 0; i < list.model.count; ++i)
{
trackList.push(list.model.get(i).url);
}
console.log(trackList)
playlistDialog.tracks = trackList
playlistDialog.open()
}
// Component.onCompleted: forceActiveFocus()
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment