1
0
mirror of synced 2025-01-31 04:03:45 +01:00

Code style

This commit is contained in:
seth 2020-12-10 18:14:03 +00:00 committed by Jennifer Taylor
parent 349a34d25d
commit d32c8fafa6
5 changed files with 4 additions and 10 deletions

View File

@ -101,7 +101,6 @@ def viewnetworkrecords() -> Response:
frontend = MusecaFrontend(g.data, g.config, g.cache)
network_records = frontend.get_network_records()
versions = {version: name for (game, version, name) in frontend.all_games()}
versions[10002] = 'MÚSECA PLUS'
return render_react(
'Global MÚSECA Records',
@ -139,7 +138,6 @@ def viewrecords(userid: UserID) -> Response:
if info is None:
abort(404)
versions = {version: name for (game, version, name) in frontend.all_games()}
versions[10002] = 'MÚSECA PLUS' # Hard code this version name for modpack songs
return render_react(
f'{info["name"]}\'s MÚSECA Records',

View File

@ -24,6 +24,7 @@ class MusecaFrontend(FrontendBase):
def all_games(self) -> Iterator[Tuple[str, int, str]]:
yield from MusecaFactory.all_games()
yield ('museca', 10002, 'MÚSECA PLUS') # Hard code entry for MÚSECA PLUS since entries will go in blank category otherwise
def format_score(self, userid: UserID, score: Score) -> Dict[str, Any]:
formatted_score = super().format_score(userid, score)

View File

@ -101,7 +101,6 @@ def viewnetworkrecords() -> Response:
frontend = PopnMusicFrontend(g.data, g.config, g.cache)
network_records = frontend.get_network_records()
versions = {version: name for (game, version, name) in frontend.all_games()}
versions[0] = 'CS and Licenses'
return render_react(
'Global Pop\'n Music Records',
@ -139,7 +138,6 @@ def viewrecords(userid: UserID) -> Response:
if info is None:
abort(404)
versions = {version: name for (game, version, name) in frontend.all_games()}
versions[0] = 'CS and Licenses'
return render_react(
f'{info["name"]}\'s Pop\'n Music Records',

View File

@ -33,6 +33,7 @@ class PopnMusicFrontend(FrontendBase):
def all_games(self) -> Iterator[Tuple[str, int, str]]:
yield from PopnMusicFactory.all_games()
yield ('pnm', 0, 'CS and Licenses') # Folder that doesn't belong to any specific game
def format_score(self, userid: UserID, score: Score) -> Dict[str, Any]:
formatted_score = super().format_score(userid, score)

View File

@ -2843,13 +2843,9 @@ class ImportMuseca(ImportBase):
actual_version = {
'1': VersionConstants.MUSECA,
'1+1/2': VersionConstants.MUSECA_1_PLUS,
'plus': VersionConstants.MUSECA_1_PLUS + DBConstants.OMNIMIX_VERSION_BUMP,
}.get(version, -1)
elif version == 'plus':
actual_version = VersionConstants.MUSECA_1_PLUS + DBConstants.OMNIMIX_VERSION_BUMP
if actual_version in [VersionConstants.MUSECA, VersionConstants.MUSECA_1_PLUS]:
self.charts = [0, 1, 2, 3]
elif actual_version == VersionConstants.MUSECA_1_PLUS + DBConstants.OMNIMIX_VERSION_BUMP:
if actual_version in [VersionConstants.MUSECA, VersionConstants.MUSECA_1_PLUS, VersionConstants.MUSECA_1_PLUS + DBConstants.OMNIMIX_VERSION_BUMP]:
self.charts = [0, 1, 2, 3]
else:
raise Exception("Unsupported Museca version, expected one of the following: 1, 1+1/2, plus!")