- if (i.real) {
- auto j = mounted_synths.find(i.prt);
- if (j != mounted_synths.end()) {
- LOG_DISK("Marking %1 (%2) as mounted because it contains a mounted synth", i.mount_point, i.prt);
- std::copy(j->second.begin(), j->second.end(), back_inserter(i.mount_points));
+ 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 two parts
+ * of i anywhere in j we assume they are related and so i shares
+ * j's mount points.
+ */
+ if (
+ find(j.media_path.parts.begin(), j.media_path.parts.end(), i.media_path.parts[0]) != j.media_path.parts.end() &&
+ find(j.media_path.parts.begin(), j.media_path.parts.end(), i.media_path.parts[1]) != j.media_path.parts.end()) {
+ LOG_DISK("Marking %1 as mounted because %2 is (found %3 and %4)", i.device, j.device, i.media_path.parts[0], i.media_path.parts[1]);
+ std::copy(j.mount_points.begin(), j.mount_points.end(), back_inserter(i.mount_points));
+ }
+ }