From 8aa25e2ec75dada5f07a3860d668241821056f61 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 13 May 2024 23:25:25 +0200 Subject: 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. --- src/lib/config.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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); } -- cgit v1.2.3