diff --git a/bemani/frontend/iidx/endpoints.py b/bemani/frontend/iidx/endpoints.py index f5a6ac5..df51565 100644 --- a/bemani/frontend/iidx/endpoints.py +++ b/bemani/frontend/iidx/endpoints.py @@ -3,7 +3,7 @@ import re from typing import Any, Dict from flask import Blueprint, request, Response, url_for, abort -from bemani.common import ID, GameConstants, RegionConstants +from bemani.common import ID, GameConstants, RegionConstants, DBConstants from bemani.data import UserID from bemani.frontend.app import loginrequired, jsonify, render_react from bemani.frontend.iidx.iidx import IIDXFrontend @@ -195,7 +195,7 @@ def viewtopscores(musicid: int) -> Response: notecounts = [0, 0, 0, 0, 0, 0] for version in versions: - for omniadd in [0, 10000]: + for omniadd in [0, DBConstants.OMNIMIX_VERSION_BUMP]: for chart in [0, 1, 2, 3, 4, 5]: details = g.data.local.music.get_song( GameConstants.IIDX, version + omniadd, musicid, chart diff --git a/bemani/frontend/jubeat/endpoints.py b/bemani/frontend/jubeat/endpoints.py index 4b3ac09..3ca639f 100644 --- a/bemani/frontend/jubeat/endpoints.py +++ b/bemani/frontend/jubeat/endpoints.py @@ -3,7 +3,7 @@ import re from typing import Any, Dict from flask import Blueprint, request, Response, url_for, abort -from bemani.common import ID, GameConstants, VersionConstants +from bemani.common import ID, GameConstants, VersionConstants, DBConstants from bemani.data import UserID from bemani.frontend.app import loginrequired, jsonify, render_react from bemani.frontend.jubeat.jubeat import JubeatFrontend @@ -195,22 +195,23 @@ def viewtopscores(musicid: int) -> Response: difficulties = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0] for version in versions: - for chart in [0, 1, 2, 3, 4, 5]: - details = g.data.local.music.get_song( - GameConstants.JUBEAT, version, musicid, chart - ) - if details is not None: - name = details.name - artist = details.artist - genre = details.genre - if category < version: - category = version - if difficulties[chart] == 0.0: - difficulties[chart] = details.data.get_float("difficulty", 13) - if difficulties[chart] >= 13.0: - difficulties[chart] = float( - details.data.get_int("difficulty", 13) - ) + for omniadd in [0, DBConstants.OMNIMIX_VERSION_BUMP]: + for chart in [0, 1, 2, 3, 4, 5]: + details = g.data.local.music.get_song( + GameConstants.JUBEAT, version, musicid, chart + ) + if details is not None: + name = details.name + artist = details.artist + genre = details.genre + if category < version: + category = version + if difficulties[chart] == 0.0: + difficulties[chart] = details.data.get_float("difficulty", 13) + if difficulties[chart] >= 13.0: + difficulties[chart] = float( + details.data.get_int("difficulty", 13) + ) if name is None: # Not a real song!