Add a Statistics tab with a card for every soundtrack
Build / test (push) Successful in 40s
Build / build (push) Successful in 1m16s

Part of #41. The top bar has Quiz and Statistics tabs instead of the
Statistics button. The Statistics tab replaces the quiz below the top bar
(the song keeps playing) and shows every soundtrack as a card with its
plays, last played date and most and least played songs, loaded from the
new GET /api/v1/statistics/soundtracks. The cards can be searched (with
the Search popup's matching, now in SoundtrackSearch), filtered on played
or never played, and sorted A-Z, Z-A, most or least played. Clicking a
card opens a popup with all its songs.

Screenshots of the other states only differ in the top bar, and the
layout baseline is taken again with the new statistics states.
This commit is contained in:
Sansan committed 2026-10-06 23:33:00 +02:00
1 parent f7619baf34
commit a21b6e9b22
30 files changed
+25379 -2306

No files matched your search

+6
View File
@@ -144,6 +144,12 @@ func fetch_statistics_summary(on_done: Callable, on_failed: Callable = Callable(
get_json_object("/statistics/summary", StatisticsSummary, on_done, on_failed)
## Fetches every soundtrack with its songs and play counts, sorted by name, as an
## [code]Array[SoundtrackWithSongs][/code].
func fetch_soundtrack_statistics(on_done: Callable, on_failed: Callable = Callable()) -> void:
get_json_list("/statistics/soundtracks", SoundtrackWithSongs, on_done, on_failed)
## Fetches the [param limit] most played soundtracks as an
## [code]Array[SoundtrackWithSongs][/code]. The server allows a limit of 1 to 100.
func fetch_most_played_soundtracks(
+50
View File
@@ -2455,6 +2455,56 @@
]
}
},
"/api/v1/statistics/soundtracks": {
"get": {
"description": "Returns every soundtrack with its songs and play counts, sorted by name.",
"operationId": "get-all-soundtrack-statistics",
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"items": {
"$ref": "#/components/schemas/SoundtrackWithSongs"
},
"type": "array"
}
}
},
"description": "OK"
},
"401": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/APIError"
}
}
},
"description": "Unauthorized"
},
"500": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/APIError"
}
}
},
"description": "Internal Server Error"
}
},
"security": [
{
"bearer": []
}
],
"summary": "All soundtracks with statistics",
"tags": [
"statistics"
]
}
},
"/api/v1/statistics/soundtracks/last-played": {
"get": {
"description": "Returns the most recently played soundtracks with their songs.",