From 0a97623df3230e3c3bc5540ab5cf89f39deb4dbf Mon Sep 17 00:00:00 2001 From: Andreas Date: Tue, 15 Jan 2013 14:03:00 +0100 Subject: [PATCH] Changed sending playlist songs --- ext/libclementine-remote/remotecontrolmessages.proto | 7 +++---- src/networkremote/outgoingdatacreator.cpp | 9 +++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ext/libclementine-remote/remotecontrolmessages.proto b/ext/libclementine-remote/remotecontrolmessages.proto index 0c542193a..385390333 100644 --- a/ext/libclementine-remote/remotecontrolmessages.proto +++ b/ext/libclementine-remote/remotecontrolmessages.proto @@ -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 diff --git a/src/networkremote/outgoingdatacreator.cpp b/src/networkremote/outgoingdatacreator.cpp index da3a9fae4..c1d854c74 100644 --- a/src/networkremote/outgoingdatacreator.cpp +++ b/src/networkremote/outgoingdatacreator.cpp @@ -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; }