summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-06-17 22:30:16 +0200
committerCarl Hetherington <cth@carlh.net>2023-06-17 23:58:11 +0200
commit2f85e751a2ff256abace3e44610817ebefb23376 (patch)
tree440b3f32bcdbf4f72ccf6251299b0492b6bd2e2a
parent7d33e1baa1cb6dd88b834c7831d419d91c194b43 (diff)
More debugging.
-rw-r--r--src/lib/find_missing.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lib/find_missing.cc b/src/lib/find_missing.cc
index edf649f5b..941456144 100644
--- a/src/lib/find_missing.cc
+++ b/src/lib/find_missing.cc
@@ -45,11 +45,15 @@ search (Replacements& replacement_paths, boost::filesystem::path directory, int
for (auto& replacement: replacement_paths) {
for (auto& path: replacement.second) {
if (!boost::filesystem::exists(path) && path.filename() == candidate.path().filename()) {
+ LOG_GENERAL("Accept %1", candidate.path());
path = candidate.path();
+ } else {
+ LOG_GENERAL("Reject %1", candidate.path());
}
}
}
} else if (boost::filesystem::is_directory(candidate.path()) && depth <= 2) {
+ LOG_GENERAL("Recurse into %1", candidate);
search (replacement_paths, candidate, depth + 1);
} else {
LOG_GENERAL("Candidate was ignored; depth=%1", candidate.path().string());
@@ -85,7 +89,13 @@ dcpomatic::find_missing (vector<shared_ptr<Content>> content_to_fix, boost::file
for (auto content: content_to_fix) {
auto const& repl = replacement_paths[content];
bool const replacements_exist = std::find_if(repl.begin(), repl.end(), [](path p) { return !exists(p); }) == repl.end();
+ LOG_GENERAL("replacements_exist? %1", replacements_exist);
+ LOG_GENERAL("digest match? %1", simple_digest(replacement_paths[content]) == content->digest());
if (replacements_exist && simple_digest(replacement_paths[content]) == content->digest()) {
+ LOG_GENERAL_NC("Setting content paths:");
+ for (auto const& i: repl) {
+ LOG_GENERAL(" %1", i);
+ }
content->set_paths (repl);
}
}