Fix key error in merging jubeat songs that don't have a set music rate.
This commit is contained in:
parent
d13eb62b30
commit
6de1cd7e6d
@ -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 {}),
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user