CHUNITHM - dev branch GetRivalMusicApi is broken #57
Labels
No Label
aimedb
bug
chuni
chusan
cxb
database
diva
doc
duplicate
enhancement
frontend
help wanted
idac
idz
invalid
maidx
ongeki
pokken
question
seen
system
testing
wacca
waiting
wip
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Hay1tsme/artemis#57
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently the api is using all playlogs to build user's rival music.
The function self.data.score.get_rival_music(rival_id) requires rival_id, index, count which are 3 params, but only 1 passed here.
But fixing this won't work either.
According to the code, len(all_entries) will always <= max_count because all_entries = get_rival_music(...), which uses the max count as a limit param.
And after compressing all musics in all_entries into a list that based on music_id, the result will always <= max_count because there must be some duplicated music_ids with different levels. So after packing them into another list, The list size can only shrink or remain the same.
So the "nextIndex": str(next_index + len(all_entries) if len(all_entries) <= len(user_rival_music_list) else -1) in result dict will almost always -1.
There are 2 places need to patch.
The first one is to replace the table in function "get_rival_music" from playlog to best_score. The things that currently in the code do is to build a best score list from playlogs. And the parameter index and count are useless too.
The second one is to modify the function "handle_get_user_rival_music_api_request".
I'm currently using these codes as a fix to this problem and is now testing with multiple accounts, each with 1000+ best scores. I'll update this issue once the test got a result.
Chunithm - dev branch GetRivalMusicApi is brokento CHUNITHM - dev branch GetRivalMusicApi is brokenSee if my recent commits help this issue; I encountered this as well earlier, and I thought I fixed it with one of them. If not, we can merge your changes as well!
Thank you for the fix! I've tested and confirmed this is working, so I added it to my current PR.