+ /* Mark containers of mounted synths as themselves mounted */
+ for (auto& i: disks) {
+ if (i.media_path.real) {
+ for (auto& j: disks) {
+ if (!j.media_path.real && !j.mount_points.empty()) {
+ /* i is real, j is a mounted synth; if we see the first MEDIA_PATH_REQUIRED_MATCHES parts
+ * of i anywhere in j we assume they are related and so i shares j's mount points.
+ */
+ bool one_missing = false;
+ string all_parts;
+ DCPOMATIC_ASSERT (i.media_path.parts.size() >= MEDIA_PATH_REQUIRED_MATCHES);
+ for (auto k = 0; k < MEDIA_PATH_REQUIRED_MATCHES; ++k) {
+ if (find(j.media_path.parts.begin(), j.media_path.parts.end(), i.media_path.parts[k]) == j.media_path.parts.end()) {
+ one_missing = true;
+ }
+ all_parts += i.media_path.parts[k] + " ";
+ }
+
+ if (!one_missing) {
+ LOG_DISK("Marking %1 as mounted because %2 is (found %3)", i.device, j.device, all_parts);
+ std::copy(j.mount_points.begin(), j.mount_points.end(), back_inserter(i.mount_points));
+ }
+ }
+ }
+ }
+ }