From d57aa934017c1272bb9f940504bf968a699b8dc0 Mon Sep 17 00:00:00 2001 From: ThatzOkay Date: Thu, 30 May 2024 09:28:07 +0200 Subject: [PATCH] Fix for diva reader when trying to read modded content. When it can't parse a number. So instead of crashing give a friendly error and continue --- changelog.md | 5 +++++ titles/diva/read.py | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 0e8b39a..3f8c6ba 100644 --- a/changelog.md +++ b/changelog.md @@ -1,7 +1,12 @@ # Changelog Documenting updates to ARTEMiS, to be updated every time the master branch is pushed to. +## 20240530 +### DIVA ++ Fix reader for when dificulty is not a int + ## 20240526 +### DIVA + Fixed missing awaits causing coroutine error ## 20240524 diff --git a/titles/diva/read.py b/titles/diva/read.py index 97c9481..64603ca 100644 --- a/titles/diva/read.py +++ b/titles/diva/read.py @@ -183,7 +183,11 @@ class DivaReader(BaseReader): pv_list[pv_id] = self.add_branch(pv_list[pv_id], key_args, val) for pv_id, pv_data in pv_list.items(): - song_id = int(pv_id.split("_")[1]) + try: + song_id = int(pv_id.split("_")[1]) + except ValueError: + self.logger.error(f"Invalid song ID format: {pv_id}") + continue if "songinfo" not in pv_data: continue if "illustrator" not in pv_data["songinfo"]: