Incremented the database version so that next rescan will force rescan to detect missing WMA covers
This commit is contained in:
@@ -130,5 +130,11 @@ ScanSettings::setClusterTypes(Session& session, const std::set<std::string>& clu
|
||||
_scanVersion += 1;
|
||||
}
|
||||
|
||||
void
|
||||
ScanSettings::incScanVersion()
|
||||
{
|
||||
_scanVersion += 1;
|
||||
}
|
||||
|
||||
} // namespace Database
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ class ScanSettings : public Wt::Dbo::Dbo<ScanSettings>
|
||||
void setUpdateStartTime(Wt::WTime t) { _startTime = t; }
|
||||
void setUpdatePeriod(UpdatePeriod p) { _updatePeriod = p; }
|
||||
void setClusterTypes(Session& session, const std::set<std::string>& clusterTypeNames);
|
||||
void setAudioFileExtensions(std::set<std::filesystem::path> fileExtensions);
|
||||
void incScanVersion();
|
||||
|
||||
template<class Action>
|
||||
void persist(Action& a)
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
namespace Database {
|
||||
|
||||
#define LMS_DATABASE_VERSION 6
|
||||
#define LMS_DATABASE_VERSION 7
|
||||
|
||||
using Version = std::size_t;
|
||||
|
||||
@@ -102,6 +102,12 @@ Session::doDatabaseMigrationIfNeeded()
|
||||
LMS_LOG(DB, INFO) << "Migrating database from version 5...";
|
||||
_session.execute("DELETE FROM auth_token"); // format has changed
|
||||
break;
|
||||
case 6:
|
||||
LMS_LOG(DB, INFO) << "Migrating database from version 6...";
|
||||
// Just increment the scan version of the settings to make the next scheduled scan rescan everything
|
||||
ScanSettings::get(*this).modify()->incScanVersion();
|
||||
break;
|
||||
|
||||
default:
|
||||
LMS_LOG(DB, ERROR) << "Database version " << version << " cannot be handled using migration";
|
||||
throw LmsException { LMS_DATABASE_VERSION > version ? outdatedMsg : "Server binary outdated, please upgrade it to handle this database"};
|
||||
|
||||
Reference in New Issue
Block a user