Skip to content

Commit

Permalink
Subsonic API: set the cover art to be the one of the first track for …
Browse files Browse the repository at this point in the history
…playlists. fixes epoupon#388
  • Loading branch information
epoupon committed Dec 15, 2023
1 parent 73c84b0 commit c016efa
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/subsonic/impl/responses/Playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "Playlist.hpp"

#include "database/Track.hpp"
#include "database/TrackList.hpp"
#include "database/User.hpp"
#include "SubsonicId.hpp"
Expand All @@ -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;
}
}

0 comments on commit c016efa

Please sign in to comment.