fix(import): name merged parts after their folder and clean up empty ones
This commit is contained in:
+5
-1
@@ -816,7 +816,11 @@ $("#import-merge").addEventListener("click", () => {
|
||||
toast("Die Einträge liegen in verschiedenen Ordnern", true);
|
||||
return;
|
||||
}
|
||||
const name = commonPrefix(chosen.map((it) => it.name)) || chosen[0].name;
|
||||
// parts may share no prefix at all ("A - Sphinx", "B - Volk"): then the
|
||||
// folder holding them carries the real title ("100 - Toteninsel")
|
||||
const parentName = (chosen[0].rel_dir || "").split("/").filter(Boolean).pop();
|
||||
const name =
|
||||
commonPrefix(chosen.map((it) => it.name)) || parentName || chosen[0].name;
|
||||
const merged = {
|
||||
path: chosen[0].path.slice(0, chosen[0].path.length - chosen[0].name.length - 1) || chosen[0].path,
|
||||
name,
|
||||
|
||||
Reference in New Issue
Block a user