add difficulty sorting menu

This commit is contained in:
Yonokid
2025-08-13 02:14:02 -04:00
parent f27dfc023b
commit d4b90436be
6 changed files with 379 additions and 82 deletions

View File

@@ -40,11 +40,13 @@ class Note:
return self.hit_ms == other.hit_ms
def _get_hash_data(self) -> bytes:
"""Get deterministic byte representation for hashing"""
hash_fields = ['type', 'hit_ms', 'load_ms']
field_values = []
for f in sorted([f.name for f in fields(self)]):
value = getattr(self, f, None)
field_values.append((f, value))
for field_name in sorted(hash_fields):
value = getattr(self, field_name, None)
field_values.append((field_name, value))
field_values.append(('__class__', self.__class__.__name__))
hash_string = str(field_values)
return hash_string.encode('utf-8')