Subsonic API: set the cover art to be the one of the first track for playlists. fixes #388
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
|
||||
#include "Playlist.hpp"
|
||||
|
||||
#include "database/Track.hpp"
|
||||
#include "database/TrackList.hpp"
|
||||
#include "database/User.hpp"
|
||||
#include "SubsonicId.hpp"
|
||||
@@ -41,6 +42,9 @@ namespace API::Subsonic
|
||||
playlistNode.setAttribute("created", reportedDummyDate);
|
||||
playlistNode.setAttribute("owner", tracklist->getUser()->getLoginName());
|
||||
|
||||
if (const auto entry {tracklist->getEntry(0)})
|
||||
playlistNode.setAttribute("coverArt", idToString(entry->getTrack()->getId()));
|
||||
|
||||
return playlistNode;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user