- ID
- 28c86e50-1946-45ec-9c8d-7ed612a32dbd
RAdb
Description
RAdb exposes various parts of the RetroArch experience via a public API. The API adheres to the REST principles and exposes a series of resources, initially including: playlogs, states, saves, screenshots, playlists
Ingestor
API
The API for RAdb exposes the various models that GOrm keeps track of.
Resources
Playlogs
Overview
Playlogs are very basic files with the lrtl extension stored on the filesystemm, usually in the retroarch a default configuration directory ($HOME/.config/retroarch). Their contents are, for example:
#+BEGIN_SRC json
{
"version": "1.0",
"runtime": "1:18:21",
"last_played": "2023-09-14 00:58:05"
}
#+END_SRC
Version is just the version of the Retroarch playlog file. Runtime is how long (accumulative) the game has been played. And last_played is the last time this game was begun (maybe last time it was finished?)
The inherent limitation here is that we don't get any idea of the history of plays. Just total time and the last time played. Thus, it's not enough for this endpoint to just scrape the filesystem on demand, it will need to scrape the filesystem for new files on a cadence and create database records for each playlog change.
Endpoints
/playlogs/
A GET endpoint which lists all available playlogs with the following output:
#+BEGIN_SRC json
[
{
"core": "Beetle PCE",
"version": "1.0",
"runtime": "0:08:00",
"last_played": "2023-09-14 00:58:05",
"game_title": "Alien Crush [U]",
"user_id": "secstate"
},
{
"core": "Beetle PCE",
"version": "1.0",
"runtime": "0:08:00",
"last_played": "2023-09-13 00:08:05",
"game_title": "Alien Crush [U]",
"user_id": "secstate"
}
]
#+END_SRC
/states/
A GET endpoint which lists all available states with the following output:
#+BEGIN_SRC json
[
{
"core": "Beetle PCE",
"created": "2023-09-14 00:58:05",
"game_title": "Bomberman '\''93 (USA)",
"user_id": "secstate"
"state_count": 1,
"state_file_path": "/states/Bomberman '\''93 (USA).state1"
"screenshot_file_path": "/states/Bomberman '\''93 (USA).state1.png"
},
{
"core": "Beetle PCE",
"version": "1.0",
"runtime": "0:08:00",
"last_played": "2023-09-13 00:08:00",
"game_title": "Alien Crush [U]",
"user_id": "secstate"
}
]
#+END_SRC