MUSECA: API and webui fixes for Museca PLUS
This commit is contained in:
parent
82a67e0792
commit
1a4a231066
@ -165,11 +165,8 @@ class CatalogObject(BaseObject):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def music_version(self) -> int:
|
def music_version(self) -> int:
|
||||||
if self.game == GameConstants.IIDX:
|
if self.omnimix:
|
||||||
if self.omnimix:
|
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
||||||
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
|
||||||
else:
|
|
||||||
return self.version
|
|
||||||
else:
|
else:
|
||||||
return self.version
|
return self.version
|
||||||
|
|
||||||
|
@ -222,13 +222,10 @@ class RecordsObject(BaseObject):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def music_version(self) -> int:
|
def music_version(self) -> int:
|
||||||
if self.game == GameConstants.IIDX:
|
|
||||||
if self.omnimix:
|
if self.omnimix:
|
||||||
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
||||||
else:
|
else:
|
||||||
return self.version
|
return self.version
|
||||||
else:
|
|
||||||
return self.version
|
|
||||||
|
|
||||||
def fetch_v1(self, idtype: str, ids: List[str], params: Dict[str, Any]) -> List[Dict[str, Any]]:
|
def fetch_v1(self, idtype: str, ids: List[str], params: Dict[str, Any]) -> List[Dict[str, Any]]:
|
||||||
since = params.get('since')
|
since = params.get('since')
|
||||||
|
@ -25,13 +25,10 @@ class StatisticsObject(BaseObject):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def music_version(self) -> int:
|
def music_version(self) -> int:
|
||||||
if self.game == GameConstants.IIDX:
|
|
||||||
if self.omnimix:
|
if self.omnimix:
|
||||||
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
return self.version + DBConstants.OMNIMIX_VERSION_BUMP
|
||||||
else:
|
else:
|
||||||
return self.version
|
return self.version
|
||||||
else:
|
|
||||||
return self.version
|
|
||||||
|
|
||||||
def __is_play(self, attempt: Attempt) -> bool:
|
def __is_play(self, attempt: Attempt) -> bool:
|
||||||
if self.game in [
|
if self.game in [
|
||||||
|
@ -185,15 +185,16 @@ def viewtopscores(musicid: int) -> Response:
|
|||||||
difficulties = [0, 0, 0, 0, 0]
|
difficulties = [0, 0, 0, 0, 0]
|
||||||
|
|
||||||
for version in versions:
|
for version in versions:
|
||||||
for chart in [0, 1, 2, 3, 4]:
|
for omniadd in [0, 10000]:
|
||||||
details = g.data.local.music.get_song(GameConstants.MUSECA, version, musicid, chart)
|
for chart in [0, 1, 2, 3, 4]:
|
||||||
if details is not None:
|
details = g.data.local.music.get_song(GameConstants.MUSECA, version + omniadd, musicid, chart)
|
||||||
if name is None:
|
if details is not None:
|
||||||
name = details.name
|
if name is None:
|
||||||
if artist is None:
|
name = details.name
|
||||||
artist = details.artist
|
if artist is None:
|
||||||
if difficulties[chart] == 0:
|
artist = details.artist
|
||||||
difficulties[chart] = details.data.get_int('difficulty')
|
if difficulties[chart] == 0:
|
||||||
|
difficulties[chart] = details.data.get_int('difficulty')
|
||||||
|
|
||||||
if name is None:
|
if name is None:
|
||||||
# Not a real song!
|
# Not a real song!
|
||||||
|
Loading…
x
Reference in New Issue
Block a user