Changed sending playlist songs

This commit is contained in:
Andreas 2013-01-15 14:03:00 +01:00
parent 06568248fc
commit 0a97623df3
2 changed files with 10 additions and 6 deletions

View File

@ -64,10 +64,6 @@ message Playlist {
optional string name = 2;
optional int32 item_count = 3;
optional bool active = 4;
// The songs are only sent when the client requests them.
// See src/remotecontrol/outgoingdatacreator.cpp for more info
repeated SongMetadata songs = 10;
}
// Valid Repeatmodes
@ -133,6 +129,9 @@ message ResponsePlaylists {
// A list of songs in a playlist
message ResponsePlaylistSongs {
optional Playlist requested_playlist = 1;
// The songs that are in the playlist
repeated SongMetadata songs = 2;
}
// The current state of the play engine

View File

@ -216,9 +216,14 @@ void OutgoingDataCreator::SendPlaylistSongs(int id) {
// Create the message and the playlist
pb::remote::Message msg;
msg.set_type(pb::remote::PLAYLIST_SONGS);
// Create the Response message
pb::remote::ResponsePlaylistSongs* pb_response_playlist_songs =
msg.mutable_response_playlist_songs();
// Create a new playlist
pb::remote::Playlist* pb_playlist =
msg.mutable_response_playlist_songs()->mutable_requested_playlist();
pb_response_playlist_songs->mutable_requested_playlist();
pb_playlist->set_id(id);
// Send all songs
@ -228,7 +233,7 @@ void OutgoingDataCreator::SendPlaylistSongs(int id) {
while(it.hasNext()) {
Song song = it.next();
QString art = song.art_automatic();
pb::remote::SongMetadata* pb_song = pb_playlist->add_songs();
pb::remote::SongMetadata* pb_song = pb_response_playlist_songs->add_songs();
CreateSong(song, art, index, pb_song);
++index;
}