1
0
mirror of synced 2024-11-27 23:50:47 +01:00

Fix key error in merging jubeat songs that don't have a set music rate.

This commit is contained in:
Jennifer Taylor 2022-11-12 22:56:06 +00:00
parent d13eb62b30
commit 6de1cd7e6d

View File

@ -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 {}),
},
)