Associate user provided images with playlists (using EXTIMG or same named file), fixes #833
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "core/ILogger.hpp"
|
||||
#include "database/Session.hpp"
|
||||
#include "database/objects/Artwork.hpp"
|
||||
#include "database/objects/Directory.hpp"
|
||||
#include "database/objects/MediaLibrary.hpp"
|
||||
#include "database/objects/Track.hpp"
|
||||
@@ -181,4 +182,19 @@ namespace lms::db
|
||||
root["files"] = std::move(fileArray);
|
||||
_entries = Wt::Json::serialize(root);
|
||||
}
|
||||
|
||||
void PlayListFile::setCoverImageFile(const std::filesystem::path& file)
|
||||
{
|
||||
_coverImageFile = file;
|
||||
}
|
||||
|
||||
void PlayListFile::updatePreferredArtwork(Session& session, PlayListFileId id, ArtworkId artworkId)
|
||||
{
|
||||
session.checkWriteTransaction();
|
||||
|
||||
if (artworkId.isValid())
|
||||
utils::executeCommand(*session.getDboSession(), "UPDATE playlist_file SET preferred_artwork_id = ? WHERE id = ?", artworkId, id);
|
||||
else
|
||||
utils::executeCommand(*session.getDboSession(), "UPDATE playlist_file SET preferred_artwork_id = NULL WHERE id = ?", id);
|
||||
}
|
||||
} // namespace lms::db
|
||||
|
||||
Reference in New Issue
Block a user