Subsonic API: set the cover art to be the one of the first track for playlists. fixes #388

This commit is contained in:
emeric
2023-12-15 23:23:22 +01:00
parent 73c84b0eb5
commit c016efa3bf
@@ -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;
}
}