diff --git a/generate.py b/generate.py index 1a1afdca..1e183fc8 100755 --- a/generate.py +++ b/generate.py @@ -127,6 +127,7 @@ class Title: self.title_path = os.path.dirname(info_path) self.full_title_id_text = '%s-%s' % (self.pubid, self.tid) self.full_title_id_hex = self.info['title_id'] + self.full_title_id_num = int(self.info['title_id'], 16) # Determine cover paths self.have_cover = True @@ -257,9 +258,15 @@ def main(): print('Rebuilding index...') template = env.get_template('template_index.html') + + tmap = {t.full_title_id_num : t for t in titles} + from rank import rank + dorder = [tmap.pop(k) for k in rank] + dorder.extend(sorted(tmap.values(),key=lambda title:title.title_name)) + with open(os.path.join(output_dir, 'index.html'), 'w') as f: f.write(template.render( - titles=sorted(titles,key=lambda title:title.title_name), + titles=dorder, title_status_descriptions=title_status_descriptions, game_status_counts=game_status_counts, xemu_build_version=xemu_build_version, diff --git a/rank.py b/rank.py new file mode 100644 index 00000000..27a37f1d --- /dev/null +++ b/rank.py @@ -0,0 +1,152 @@ +rank = [ +0x5443000d, +0x4d530051, +0x49470018, +0x4d530004, +0x54430003, +0x4541000d, +0x4d530013, +0x54430007, +0x45410083, +0x4d530064, +0x45410026, +0x45410042, +0x5a440004, +0x4d530003, +0x4541005d, +0x4541005b, +0x4d53002a, +0x494c0006, +0x4d53006e, +0x56550042, +0x43430003, +0x45410079, +0x45530018, +0x4d53002d, +0x4156005d, +0x5451000d, +0x4d53004b, +0x4d530041, +0x45410049, +0x45410076, +0x4d530010, +0x4d530065, +0x54430006, +0x54540082, +0x56550016, +0x5345000f, +0x54540079, +0x56550036, +0x4d530039, +0x47450001, +0x4b420001, +0x4d530017, +0x55530036, +0x41540002, +0x43430019, +0x4b4e002d, +0x4d53006b, +0x56550003, +0x58490004, +0x4c410017, +0x4156000f, +0x48550001, +0x49470017, +0x4d530031, +0x4d530035, +0x4d530036, +0x4d530083, +0x4343000e, +0x49470013, +0x4d530005, +0x4d53001e, +0x4d530027, +0x4d53003d, +0x4d570034, +0x53550007, +0x45410012, +0x4d4a0014, +0x4d53000f, +0x53550001, +0x56550022, +0x45410091, +0x4b4e0002, +0x4d53000d, +0x54540001, +0x5844000a, +0x4156000a, +0x4156002b, +0x43430016, +0x4541000b, +0x4541003e, +0x4541007b, +0x45410389, +0x46530002, +0x4947007a, +0x4b4e0011, +0x4d530002, +0x4d570029, +0x54540008, +0x5454000e, +0x55530018, +0x41430006, +0x4143000a, +0x43430001, +0x4541005f, +0x45410062, +0x4d530007, +0x4d530021, +0x4d530069, +0x4d530080, +0x53450038, +0x544b0004, +0x545400b0, +0x564e0006, +0x41430016, +0x45410037, +0x45410060, +0x454100a0, +0x45530005, +0x47450002, +0x49460001, +0x49470024, +0x4947007c, +0x4c41001a, +0x4d5300cd, +0x4d57000e, +0x544d0001, +0x5454000f, +0x5454008a, +0x42520001, +0x43430008, +0x4541000e, +0x45410028, +0x45410066, +0x46490002, +0x46530005, +0x49470022, +0x4947002c, +0x49470039, +0x4c410003, +0x4c41000d, +0x4c410015, +0x4d530053, +0x53450086, +0x53570001, +0x41510001, +0x41560035, +0x42410001, +0x44430002, +0x4541005e, +0x454d0001, +0x4947002b, +0x4b4e0007, +0x4b4e0038, +0x4b550001, +0x4c410011, +0x53450004, +0x5345002b, +0x534e0007, +0x53550008, +0x54430004, +] \ No newline at end of file