Add TODOs for get recommended list endpoints.
This commit is contained in:
parent
4b771feb16
commit
63dea09802
@ -999,6 +999,8 @@ class JubeatClan(
|
||||
music_list = Node.void('music_list')
|
||||
player.add_child(music_list)
|
||||
|
||||
# TODO: Might be a way to figure out who plays what song and then offer
|
||||
# recommendations based on that. There should be 12 songs returned here.
|
||||
recommended_songs: List[Song] = []
|
||||
for i, song in enumerate(recommended_songs):
|
||||
music = Node.void('music')
|
||||
|
@ -14,7 +14,7 @@ from bemani.backend.jubeat.clan import JubeatClan
|
||||
|
||||
from bemani.backend.base import Status
|
||||
from bemani.common import Profile, ValidatedDict, VersionConstants
|
||||
from bemani.data import UserID, Score
|
||||
from bemani.data import UserID, Score, Song
|
||||
from bemani.protocol import Node
|
||||
|
||||
|
||||
@ -410,6 +410,28 @@ class JubeatFesto(
|
||||
|
||||
return shopinfo
|
||||
|
||||
def handle_recommend_get_recommend_request(self, request: Node) -> Node:
|
||||
recommend = Node.void('recommend')
|
||||
data = Node.void('data')
|
||||
recommend.add_child(data)
|
||||
|
||||
player = Node.void('player')
|
||||
data.add_child(player)
|
||||
music_list = Node.void('music_list')
|
||||
player.add_child(music_list)
|
||||
|
||||
# TODO: Might be a way to figure out who plays what song and then offer
|
||||
# recommendations based on that. There should be 12 songs returned here.
|
||||
recommended_songs: List[Song] = []
|
||||
for i, song in enumerate(recommended_songs):
|
||||
music = Node.void('music')
|
||||
music_list.add_child(music)
|
||||
music.set_attribute('order', str(i))
|
||||
music.add_child(Node.s32('music_id', song.id))
|
||||
music.add_child(Node.s8('seq', song.chart))
|
||||
|
||||
return recommend
|
||||
|
||||
def handle_gametop_regist_request(self, request: Node) -> Node:
|
||||
data = request.child('data')
|
||||
player = data.child('player')
|
||||
|
@ -16,7 +16,7 @@ from bemani.backend.jubeat.common import (
|
||||
from bemani.backend.jubeat.prop import JubeatProp
|
||||
|
||||
from bemani.common import Profile, ValidatedDict, VersionConstants
|
||||
from bemani.data import Data, Score, UserID
|
||||
from bemani.data import Data, Score, Song, UserID
|
||||
from bemani.protocol import Node
|
||||
|
||||
|
||||
@ -398,15 +398,18 @@ class JubeatQubell(
|
||||
|
||||
player = Node.void('player')
|
||||
data.add_child(player)
|
||||
player.add_child(Node.void('music_list'))
|
||||
# Music list should contain nodes like this (12 of them
|
||||
# in total for a recommended list). If it isn't provided,
|
||||
# the game will substitute a default. The order valid range
|
||||
# is 0-11 inclusive (12 total).
|
||||
# <music order="order">
|
||||
# <music_id __type="s32">id</music_id>
|
||||
# <seq __type="s8">chart</seq>
|
||||
# </music>
|
||||
music_list = Node.void('music_list')
|
||||
player.add_child(music_list)
|
||||
|
||||
# TODO: Might be a way to figure out who plays what song and then offer
|
||||
# recommendations based on that. There should be 12 songs returned here.
|
||||
recommended_songs: List[Song] = []
|
||||
for i, song in enumerate(recommended_songs):
|
||||
music = Node.void('music')
|
||||
music_list.add_child(music)
|
||||
music.set_attribute('order', str(i))
|
||||
music.add_child(Node.s32('music_id', song.id))
|
||||
music.add_child(Node.s8('seq', song.chart))
|
||||
|
||||
return recommend
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user