Update frontend to use Subject38's proper categories as extracted from Jubeat XML.
This commit is contained in:
parent
8d67760788
commit
05e4ef0cb8
@ -37,6 +37,7 @@ class CatalogObject(BaseObject):
|
||||
def __format_jubeat_song(self, song: Song) -> Dict[str, Any]:
|
||||
return {
|
||||
'difficulty': song.data.get_int('difficulty'),
|
||||
'category': song.data.get_int('version'),
|
||||
'bpm_min': song.data.get_int('bpm_min'),
|
||||
'bpm_max': song.data.get_int('bpm_max'),
|
||||
}
|
||||
|
@ -923,6 +923,7 @@ class GlobalMusicData(BaseGlobalData):
|
||||
'bpm_min': int(data['bpm_min']),
|
||||
'bpm_max': int(data['bpm_max']),
|
||||
'difficulty': int(data['difficulty']),
|
||||
'version': int(data.get('category', int(songid / 10000000))),
|
||||
},
|
||||
)
|
||||
|
||||
|
@ -80,6 +80,21 @@ class JubeatFrontend(FrontendBase):
|
||||
formatted_song['bpm_min'] = song.data.get_int('bpm_min', 120)
|
||||
formatted_song['bpm_max'] = song.data.get_int('bpm_max', 120)
|
||||
formatted_song['difficulties'] = difficulties
|
||||
formatted_song['version'] = {
|
||||
VersionConstants.JUBEAT: 1,
|
||||
VersionConstants.JUBEAT_RIPPLES: 2,
|
||||
VersionConstants.JUBEAT_RIPPLES_APPEND: 2,
|
||||
VersionConstants.JUBEAT_KNIT: 3,
|
||||
VersionConstants.JUBEAT_KNIT_APPEND: 3,
|
||||
VersionConstants.JUBEAT_COPIOUS: 4,
|
||||
VersionConstants.JUBEAT_COPIOUS_APPEND: 4,
|
||||
VersionConstants.JUBEAT_SAUCER: 5,
|
||||
VersionConstants.JUBEAT_SAUCER_FULFILL: 5,
|
||||
VersionConstants.JUBEAT_PROP: 6,
|
||||
VersionConstants.JUBEAT_QUBELL: 7,
|
||||
VersionConstants.JUBEAT_CLAN: 8,
|
||||
VersionConstants.JUBEAT_FESTO: 9,
|
||||
}.get(song.data.get_int('version', 1), 1)
|
||||
return formatted_song
|
||||
|
||||
def merge_song(self, existing: Dict[str, Any], new: Song) -> Dict[str, Any]:
|
||||
|
@ -129,7 +129,11 @@ var network_records = React.createClass({
|
||||
|
||||
renderBySeries: function() {
|
||||
var songids = Object.keys(this.state.songs).sort(function(a, b) {
|
||||
return parseInt(b) - parseInt(a);
|
||||
if (this.state.songs[a].version == this.state.songs[b].version) {
|
||||
return parseInt(b) - parseInt(a);
|
||||
} else {
|
||||
return this.state.songs[b].version - this.state.songs[a].version;
|
||||
}
|
||||
}.bind(this));
|
||||
if (window.filterempty) {
|
||||
songids = songids.filter(function(songid) {
|
||||
@ -139,7 +143,7 @@ var network_records = React.createClass({
|
||||
var lastSeries = 0;
|
||||
var lastSeries = 0;
|
||||
for (var i = 0; i < songids.length; i++) {
|
||||
var curSeries = Math.floor(songids[i] / 10000000);
|
||||
var curSeries = this.state.songs[songids[i]].version;
|
||||
if (curSeries != lastSeries) {
|
||||
lastSeries = curSeries;
|
||||
songids.splice(i, 0, curSeries);
|
||||
|
@ -1384,6 +1384,7 @@ class ImportJubeat(ImportBase):
|
||||
'title': None,
|
||||
'artist': None,
|
||||
'genre': genre,
|
||||
'version': version_to_db_constant.get(earliest_version),
|
||||
'bpm_min': bpm_min,
|
||||
'bpm_max': bpm_max,
|
||||
'difficulty': {
|
||||
@ -1391,7 +1392,6 @@ class ImportJubeat(ImportBase):
|
||||
'advanced': difficulties[1],
|
||||
'extreme': difficulties[2],
|
||||
},
|
||||
'version': version_to_db_constant.get(earliest_version),
|
||||
})
|
||||
|
||||
emblems: List[Dict[str, Any]] = []
|
||||
@ -1446,6 +1446,7 @@ class ImportJubeat(ImportBase):
|
||||
'title': song.name,
|
||||
'artist': song.artist,
|
||||
'genre': song.genre,
|
||||
'version': song.data.get_int('version'),
|
||||
'bpm_min': song.data.get_int('bpm_min'),
|
||||
'bpm_max': song.data.get_int('bpm_max'),
|
||||
'difficulty': {
|
||||
@ -1512,6 +1513,7 @@ class ImportJubeat(ImportBase):
|
||||
'difficulty': song['difficulty'][chart_map[chart]],
|
||||
'bpm_min': song['bpm_min'],
|
||||
'bpm_max': song['bpm_max'],
|
||||
'version': song['version'],
|
||||
}
|
||||
self.insert_music_id_for_song(next_id, songid, chart, song['title'], song['artist'], song['genre'], data)
|
||||
self.finish_batch()
|
||||
|
Loading…
Reference in New Issue
Block a user