Added date/time field for tracklist, added a LmsApplicationManager to make scrobbler register for played tracks
This commit is contained in:
@@ -39,10 +39,11 @@
|
||||
#include "database/TrackFeatures.hpp"
|
||||
#include "database/User.hpp"
|
||||
|
||||
namespace Database {
|
||||
namespace Database
|
||||
{
|
||||
|
||||
using Version = std::size_t;
|
||||
static constexpr Version LMS_DATABASE_VERSION {29};
|
||||
static constexpr Version LMS_DATABASE_VERSION {30};
|
||||
|
||||
class VersionInfo
|
||||
{
|
||||
@@ -78,7 +79,7 @@ namespace Database {
|
||||
|
||||
private:
|
||||
int _version {LMS_DATABASE_VERSION};
|
||||
};
|
||||
};
|
||||
|
||||
void
|
||||
Session::doDatabaseMigrationIfNeeded()
|
||||
@@ -315,6 +316,11 @@ CREATE TABLE "user_backup" (
|
||||
_session.execute("DROP TABLE user");
|
||||
_session.execute("ALTER TABLE user_backup RENAME TO user");
|
||||
}
|
||||
else if (version == 29)
|
||||
{
|
||||
// new field data_time in tracklist_entry (used by async scrobble or to make stats)
|
||||
_session.execute("ALTER TABLE tracklist_entry ADD date_time TEXT");
|
||||
}
|
||||
else
|
||||
{
|
||||
LMS_LOG(DB, ERROR) << "Database version " << version << " cannot be handled using migration";
|
||||
|
||||
Reference in New Issue
Block a user