Commit 58a981d2 authored by Max Kellermann's avatar Max Kellermann

DatabaseSave: add constant OLDEST_DB_FORMAT

parent 8963cd1f
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
static constexpr unsigned DB_FORMAT = 1; static constexpr unsigned DB_FORMAT = 1;
/**
* The oldest database format understood by this MPD version.
*/
static constexpr unsigned OLDEST_DB_FORMAT = 1;
void void
db_save_internal(FILE *fp, const Directory &music_root) db_save_internal(FILE *fp, const Directory &music_root)
{ {
...@@ -128,7 +133,7 @@ db_load_internal(TextFile &file, Directory &music_root, Error &error) ...@@ -128,7 +133,7 @@ db_load_internal(TextFile &file, Directory &music_root, Error &error)
} }
} }
if (format != DB_FORMAT) { if (format < OLDEST_DB_FORMAT || format > DB_FORMAT) {
error.Set(db_domain, error.Set(db_domain,
"Database format mismatch, " "Database format mismatch, "
"discarding database file"); "discarding database file");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment