Associate user provided images with playlists (using EXTIMG or same named file), fixes #833

This commit is contained in:
emeric
2026-06-02 12:48:54 +02:00
parent 531c5ca24d
commit 64e183da38
22 changed files with 340 additions and 7 deletions
+8 -1
View File
@@ -35,7 +35,7 @@ namespace lms::db
{
namespace
{
static constexpr Version LMS_DATABASE_VERSION{ 104 };
static constexpr Version LMS_DATABASE_VERSION{ 105 };
}
VersionInfo::VersionInfo()
@@ -1723,6 +1723,12 @@ FROM track)");
utils::executeCommand(*session.getDboSession(), "ALTER TABLE scan_settings ADD COLUMN musicnn_model_identifier TEXT NOT NULL DEFAULT ''");
}
void migrateFromV104(Session& session)
{
utils::executeCommand(*session.getDboSession(), R"(ALTER TABLE "playlist_file" ADD COLUMN "preferred_artwork_id" bigint)");
utils::executeCommand(*session.getDboSession(), R"(ALTER TABLE "playlist_file" ADD COLUMN "cover_image_file" text NOT NULL DEFAULT '')");
}
bool doDbMigration(Session& session)
{
constexpr std::string_view outdatedMsg{ "Outdated database, please rebuild it (delete the .db file and restart)" };
@@ -1803,6 +1809,7 @@ FROM track)");
{ 101, migrateFromV101 },
{ 102, migrateFromV102 },
{ 103, migrateFromV103 },
{ 104, migrateFromV104 },
};
bool migrationPerformed{};