-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix JSON output #15
Comments
Don't know what fields are needed exactly
Looks like it expects a dictionary: https://github.com/RiiConnect24/RiiTag-RPC/blob/master/riitag/user.py#L15 not an array what we currently have/what's in your JSON. Maybe @DismissedGuy can say something about this? |
Larsen's example JSON is an example of V1's internal "database" and does not follow the same format as the public JSON API. This is where V1 generated its response: https://github.com/RiiConnect24/RiiTag/blob/b83c9bd3a1152df7eb22876dec60f5b643584e5a/app.js#L472 It's been way too long since I've touched RiiTag-RPC, but IIRC, it should expect the following format: {
"user": {
"name": <name on riitag>,
"id": <user id>
},
"tag_url": {
"normal": <url to regularly sized tag>,
"max": <url to max resolution tag>
},
"game_data": {
"last_played": {
"game_id": <game id>,
"console": <console>,
"region": <game region>,
"cover_url": <url to game cover>,
"time": <time of last launch as unix epoch>
},
"games": [ <chronologically ordered list of recently played game IDs> ]
}
}
It's worth noting that I haven't had time yet to actually check the error myself, but following the above format should in theory fix it. |
Thank you, I think I can work with this! I think some fields are unused (region? is the games array even used?) and I would like to reorganize them (making games not an array of ids but an array of dicts) |
Some fields are indeed unused; which ones exactly I cannot tell right now but I'll look into it. I do know that the games array is used to display a simple list of games the user has played in the past. I do agree that the current format isn't the best. Feel free to change it around, I can update RiiTag-RPC to support the new format. Maybe even introduce some new features if the endpoint returns more interesting data to work with. In any case, I won't be able to actually work on it until the end of the week, probably. So if a "quick fix" is required, it might be better to temporarily use that old format until then. Unless someone else feels like working on it of course. |
The API should have the same output as the original one now: JSON Output{
"user":{
"name":"Brawl",
"id":"110806999020625920"
},
"tag_url":{
"normal":"http://localhost:3000/110806999020625920/tag.png",
"max":"http://localhost:3000/110806999020625920/tag.max.png"
},
"game_data":{
"last_played":{
"game_id":"RSBJ01",
"console":"wii",
"region":"JA",
"cover_url":"http://localhost:3000/api/cover/wii/RSBJ01",
"time":1660063539985
},
"games":[
"wii-RSBJ01"
]
}
} I will make a new endpoint (like |
Looks good, but RiiTag-RPC wants the last played epoch in seconds instead of milliseconds. I made a PR to fix that: #18 |
By the way, I dug into the source code a bit, and the only data that it currently needs is the time of the last played game, the ID of that game, and the game history. All other fields appear to be unused as far as I can tell. |
* refactor: Began merging sql requests and grouping private keys * refactor: User page SQL code refactor and multi-game support * refactor: User edit page SQL optimized * refactor: Optimized SQL for edit page
* Feature: Moderation (RiiConnect24#9) (RiiConnect24#10) * feature: Added banning, and, forced hidden button * feature: Added hiding and shadow hiding users * feature: Added badges to user profile * feature: Added hiding from the front page when hidden * fix: Fixed code related to front page hiding * feature: Added game leaderboard - showing the #1 for all games * refactor: Rewrote most of the game leaderboard code * Rebase: Master -> Game Leaderboards (RiiConnect24#16) * Feature: Moderation (RiiConnect24#9) * feature: Added banning, and, forced hidden button * feature: Added hiding and shadow hiding users * feature: Added badges to user profile * feature: Added hiding from the front page when hidden * fix: Fixed code related to front page hiding * Feature: Full-Site Multilanguage support (RiiConnect24#13) * Feature: Moderation (RiiConnect24#9) (RiiConnect24#12) * feature: Added banning, and, forced hidden button * feature: Added hiding and shadow hiding users * feature: Added badges to user profile * feature: Added hiding from the front page when hidden * fix: Fixed code related to front page hiding * feature: Began adding the framework for multi-language support * feature: Full localization support and all pages and nav bars * Refactor: SQL optimization (RiiConnect24#15) * refactor: Began merging sql requests and grouping private keys * refactor: User page SQL code refactor and multi-game support * refactor: User edit page SQL optimized * refactor: Optimized SQL for edit page * feature: Added clicking to go to profile and localizations
https://github.com/RiiConnect24/RiiTag-RPC relies on getting a JSON file formatted in the format used with RiiTag v1 in order to read what games are being played. Since RiiTag v2 doesn't output this properly, RiiTag-RPC is currently broken. I think it might be only checking the games played and the timestamp.
Example JSON https://transfer.archivete.am/Pk8XE/314466499312222208.json
The text was updated successfully, but these errors were encountered: