mirror of
https://github.com/DragonMinded/bemaniutils.git
synced 2026-08-25 03:44:27 -05:00
Fix key error in merging jubeat songs that don't have a set music rate.
This commit is contained in:
@@ -401,6 +401,10 @@ class GlobalMusicData(BaseGlobalData):
|
||||
def __merge_jubeat_score(
|
||||
self, version: int, oldscore: Score, newscore: Score
|
||||
) -> Score:
|
||||
rate = self.__max(
|
||||
oldscore.data.get("music_rate", -1), newscore.data.get("music_rate", -1)
|
||||
)
|
||||
|
||||
return Score(
|
||||
-1,
|
||||
oldscore.id,
|
||||
@@ -419,9 +423,8 @@ class GlobalMusicData(BaseGlobalData):
|
||||
else newscore.data.get("ghost"),
|
||||
"combo": self.__max(oldscore.data["combo"], newscore.data["combo"]),
|
||||
"medal": self.__max(oldscore.data["medal"], newscore.data["medal"]),
|
||||
"music_rate": self.__max(
|
||||
oldscore.data["music_rate"], newscore.data["music_rate"]
|
||||
),
|
||||
# Conditionally include this if we have any info for it.
|
||||
**({"music_rate": rate} if rate >= 0 else {}),
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user