Cache character pictures and songs on disk
Build / test (push) Successful in 53s
Build / build (push) Successful in 1m13s

Character pictures are kept in characters/ next to the settings, with an
index.json of when the server last changed each one and when it was
downloaded. Only new or changed pictures are downloaded, using the server's new
/character/details. Older servers fall back to the name list, and pictures are
downloaded again after 7 days.

Downloaded songs are written to songs/ and only their paths are kept in memory.
The folder is emptied when the game starts and when the playlist resets.
This commit is contained in:
Sansan committed 2026-10-07 21:57:27 +02:00
1 parent 62fa63fd8b
commit 240c331ab2
17 files changed
+912 -48

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
# Generated by tools/generate_api_types.gd from server/openapi.json.
# Do not edit; change the server and generate again.
class_name CharacterDetails
extends RefCounted
## The [code]CharacterDetails[/code] schema of the MusicServer API.
## When the image was last changed, in Unix seconds
var modified: int
## File name of the character image
var name: String
## Reads the fields from parsed JSON. Missing fields keep their defaults.
static func from_dict(data: Dictionary) -> CharacterDetails:
var result: CharacterDetails = CharacterDetails.new()
result.modified = ApiJson.get_int(data, "modified", 0)
result.name = ApiJson.get_string(data, "name", "")
return result
## Returns the fields under their JSON names, ready for [method JSON.stringify].
func to_dict() -> Dictionary:
return {
"modified": modified,
"name": name,
}
@@ -0,0 +1 @@
uid://cu6wgjxv120en