mirror of
https://github.com/DragonMinded/bemaniutils.git
synced 2026-07-18 16:43:03 -05:00
Remove magic strings and use constants instead.
This commit is contained in:
parent
416904100b
commit
b7bd09bb62
|
|
@ -4,7 +4,7 @@ from typing import Any, Dict, Iterator, Tuple
|
|||
from flask_caching import Cache # type: ignore
|
||||
|
||||
from bemani.backend.museca import MusecaFactory, MusecaBase
|
||||
from bemani.common import GameConstants, ValidatedDict
|
||||
from bemani.common import GameConstants, VersionConstants, DBConstants, ValidatedDict
|
||||
from bemani.data import Attempt, Data, Score, Song, UserID
|
||||
from bemani.frontend.base import FrontendBase
|
||||
|
||||
|
|
@ -24,7 +24,11 @@ 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
|
||||
yield (
|
||||
GameConstants.MUSECA,
|
||||
VersionConstants.MUSECA_1_PLUS + DBConstants.OMNIMIX_VERSION_BUMP,
|
||||
'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)
|
||||
|
|
|
|||
|
|
@ -33,7 +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
|
||||
yield (GameConstants.POPN_MUSIC, 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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user