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(
|
def __merge_jubeat_score(
|
||||||
self, version: int, oldscore: Score, newscore: Score
|
self, version: int, oldscore: Score, newscore: Score
|
||||||
) -> Score:
|
) -> Score:
|
||||||
|
rate = self.__max(
|
||||||
|
oldscore.data.get("music_rate", -1), newscore.data.get("music_rate", -1)
|
||||||
|
)
|
||||||
|
|
||||||
return Score(
|
return Score(
|
||||||
-1,
|
-1,
|
||||||
oldscore.id,
|
oldscore.id,
|
||||||
@ -419,9 +423,8 @@ class GlobalMusicData(BaseGlobalData):
|
|||||||
else newscore.data.get("ghost"),
|
else newscore.data.get("ghost"),
|
||||||
"combo": self.__max(oldscore.data["combo"], newscore.data["combo"]),
|
"combo": self.__max(oldscore.data["combo"], newscore.data["combo"]),
|
||||||
"medal": self.__max(oldscore.data["medal"], newscore.data["medal"]),
|
"medal": self.__max(oldscore.data["medal"], newscore.data["medal"]),
|
||||||
"music_rate": self.__max(
|
# Conditionally include this if we have any info for it.
|
||||||
oldscore.data["music_rate"], newscore.data["music_rate"]
|
**({"music_rate": rate} if rate >= 0 else {}),
|
||||||
),
|
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user