diff options
author | Max Kellermann <max@duempel.org> | 2014-02-24 23:53:14 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-02-25 18:15:55 +0100 |
commit | 58a981d2f69254546749ebe516ccb8e01897754c (patch) | |
tree | 0ba83b45509c9c716de8c272511b36ac68fcb20c /src/db/DatabaseSave.cxx | |
parent | 8963cd1fabbe9cb54a5f246844b3fd5b1ac332cf (diff) | |
download | mpd-58a981d2f69254546749ebe516ccb8e01897754c.tar.gz mpd-58a981d2f69254546749ebe516ccb8e01897754c.tar.xz mpd-58a981d2f69254546749ebe516ccb8e01897754c.zip |
DatabaseSave: add constant OLDEST_DB_FORMAT
Diffstat (limited to 'src/db/DatabaseSave.cxx')
-rw-r--r-- | src/db/DatabaseSave.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/db/DatabaseSave.cxx b/src/db/DatabaseSave.cxx index e9c81442b..98731372e 100644 --- a/src/db/DatabaseSave.cxx +++ b/src/db/DatabaseSave.cxx @@ -43,6 +43,11 @@ static constexpr unsigned DB_FORMAT = 1; +/** + * The oldest database format understood by this MPD version. + */ +static constexpr unsigned OLDEST_DB_FORMAT = 1; + void db_save_internal(FILE *fp, const Directory &music_root) { @@ -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, "Database format mismatch, " "discarding database file"); |