summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2024-05-13 23:25:25 +0200
committerCarl Hetherington <cth@carlh.net>2024-05-13 23:27:08 +0200
commit8aa25e2ec75dada5f07a3860d668241821056f61 (patch)
treea534401a90c31f24fc157ad9f57c6878edf95b1d /src/lib
parentd2c665cba983c625933817e0bf05e298f80f0119 (diff)
Fix case where both XML and sqlite3 files are present, and config.xml still refers to the XML.
Then we would leave the config.xml pointing at the XML, and everything after that assumes that cinemas_file is sqlite3. Instead we always set the cinemas file to the sqlite3 version, and convert if it it wasn't there before.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/config.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/config.cc b/src/lib/config.cc
index 02ae7880f..374605521 100644
--- a/src/lib/config.cc
+++ b/src/lib/config.cc
@@ -686,9 +686,11 @@ Config::instance ()
if (cinemas_file.extension() == ".xml") {
auto sqlite = cinemas_file;
sqlite.replace_extension(".sqlite3");
+ bool const had_sqlite = dcp::filesystem::exists(sqlite);
- if (dcp::filesystem::exists(cinemas_file) && !dcp::filesystem::exists(sqlite)) {
- _instance->set_cinemas_file(sqlite);
+ _instance->set_cinemas_file(sqlite);
+
+ if (dcp::filesystem::exists(cinemas_file) && !had_sqlite) {
CinemaList cinemas;
cinemas.read_legacy_file(cinemas_file);
}