db/simple: fix file corruption in the presence of mount points
If a directory is a mount point, omit the "directory: " as well. This bug is years old, but has become more visible now that mount points are persistent in the state file.
This commit is contained in:
parent
e769751221
commit
c88056ba83
2
NEWS
2
NEWS
|
@ -1,4 +1,6 @@
|
||||||
ver 0.20.14 (not yet released)
|
ver 0.20.14 (not yet released)
|
||||||
|
* database
|
||||||
|
- simple: fix file corruption in the presence of mount points
|
||||||
|
|
||||||
ver 0.20.13 (2017/12/18)
|
ver 0.20.13 (2017/12/18)
|
||||||
* output
|
* output
|
||||||
|
|
|
@ -82,10 +82,11 @@ directory_save(BufferedOutputStream &os, const Directory &directory)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &child : directory.children) {
|
for (const auto &child : directory.children) {
|
||||||
os.Format(DIRECTORY_DIR "%s\n", child.GetName());
|
if (child.IsMount())
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!child.IsMount())
|
os.Format(DIRECTORY_DIR "%s\n", child.GetName());
|
||||||
directory_save(os, child);
|
directory_save(os, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const auto &song : directory.songs)
|
for (const auto &song : directory.songs)
|
||||||
|
|
Loading…
Reference in New Issue