Ipod Playlist Support (#220)
* Ipod Playlist Support Copy a whole playlist to the ipod and create an entry in Playlists on the iPod * Fix formatting and indentation Fix indenting and formatting to be consistent
This commit is contained in:
@@ -188,6 +188,19 @@ bool GPodDevice::CopyToStorage(const CopyJob &job) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Put the track in the playlist, if one is specified
|
||||
if (!job.playlist_.isEmpty()) {
|
||||
// Does the playlist already exist?
|
||||
auto itdbPlaylist = itdb_playlist_by_name(db_, job.playlist_.toUtf8().data());
|
||||
if (itdbPlaylist == nullptr) {
|
||||
// Create the playlist
|
||||
itdbPlaylist = itdb_playlist_new(job.playlist_.toUtf8().data(), false);
|
||||
itdb_playlist_add(db_, itdbPlaylist, -1);
|
||||
}
|
||||
// Playlist should exist so add the track to the playlist
|
||||
itdb_playlist_add_track(itdbPlaylist, track, -1);
|
||||
}
|
||||
|
||||
AddTrackToModel(track, url_.path());
|
||||
|
||||
// Remove the original if it was requested
|
||||
|
||||
Reference in New Issue
Block a user