Verify exact mod membership names after case-only renames (by Codex)

This commit is contained in:
Codex committed 2026-10-26 09:03:33 +01:00
1 parent 6bcd95d668
commit a0bb8b47dc
2 files changed
+14

No files matched your search

+9
View File
@@ -246,6 +246,15 @@ UiModEntry owned(const fs::path &root, const UiModEntry &expected, bool require_
if (expected.id != expected.name || expected.path != root / "mods" / editor::path(expected.id))
throw editor::Error("Die Mod gehört nicht zu dieser Bibliothek.");
member_name(expected.id);
// Library IDs use the spelling actually enumerated on disk, even when the
// host filesystem resolves an obsolete differently-cased path to it.
bool exact_member = false;
for (const auto &file : fs::directory_iterator(root / "mods"))
if (editor::utf8(file.path().filename()) == expected.id) {
exact_member = true;
break;
}
if (!exact_member) throw editor::Error("Diese Mod-ID wurde inzwischen geändert. Bitte erneut auswählen.");
if (fs::is_symlink(fs::symlink_status(expected.path)) || !fs::is_directory(expected.path))
throw editor::Error("Unsicheres oder fehlendes Mod-Verzeichnis.");
const auto actual = entry(root, expected.id);