feat: namespace mod hashes

This commit is contained in:
aclist 2026-06-11 08:02:27 +09:00
parent b35b6148bc
commit 8503d7e698
2 changed files with 11 additions and 6 deletions

View File

@ -119,10 +119,14 @@ def get_missing_mods(local: list, remote: list) -> list:
return [mod for mod in remote if mod not in local]
def _hash(uid: str) -> str:
def _hash(uid: str, use_custom: bool = False) -> str:
md5 = hashlib.md5()
md5.update(uid.encode("ascii"))
return "@" + md5.hexdigest()[:8]
if use_custom:
prefix = "@C"
else:
prefix = "@"
return prefix + md5.hexdigest()[:8]
def remove_stale_signatures(config: Path, versions: Path) -> None:

View File

@ -102,11 +102,11 @@ class ModFrame(HeadingFrame):
self.tree_vbox.extend([self.scrolled, self.status])
self.vbox.pack_end(self.tree_vbox, expand=True, fill=True, padding=3)
# self.vbox.add(self.tree_vbox)
self.frame.add(self.vbox)
#self.none_label = Gtk.Label(label="No mods found", halign=Gtk.Align.START)
#self.vbox.pack_end(self.none_label, expand=True, fill=True, padding=3)
#self.none_label.hide()
# self.vbox.add(self.tree_vbox)
# self.none_label = Gtk.Label(label="No mods found", halign=Gtk.Align.START)
# self.vbox.pack_end(self.none_label, expand=True, fill=True, padding=3)
# self.none_label.hide()
sel = self.tree.get_selection()
sel.connect("changed", self._on_selection_changed)
@ -330,5 +330,6 @@ class OfflineLoader(Gtk.Box):
# mission = self.mission_frame.get_mission()
# local_mods = self.local_frame.get_mods()
# custom_mods = self.custom_frame.get_mods()
# cf. api.mods._hash(uid, use_custom=True)
# self.offline_man.setup(appid, mission, local_mods, custom_mods)
pass