Covers: statistics cards show the soundtrack's cover on the left, and the
statistics popup shows it large. Until it arrives, and without a cover, the
soundtrack's initials stand in. Covers load only for cards on or near the
screen, three at a time, and are cached in covers/ next to the settings
(CoverCache), downloaded again only when cover_modified changes. The index and
file handling are shared with CharacterCache in a new FileCache.
Alternative names: the popup shows them and has an editor (add, remove, save)
that sends PUT /soundtracks/{uuid}/alternative-names. The statistics search and
the Search popup find soundtracks by them; Search shows the matching name after
the real one. Search now loads /soundtracks, falling back to the plain list.
The API types are regenerated from the server's spec, with a SoundtrackCover
theme style in every theme.
Closes #49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
808 B
GDScript
27 lines
808 B
GDScript
# Generated by tools/generate_api_types.gd from server/openapi.json.
|
|
# Do not edit; change the server and generate again.
|
|
class_name CoverSource
|
|
extends RefCounted
|
|
## The [code]CoverSource[/code] schema of the MusicServer API.
|
|
|
|
## The game's ID on SteamGridDB, or the anime's ID on AniList
|
|
var id: String
|
|
## Where the cover comes from
|
|
var source: String
|
|
|
|
|
|
## Reads the fields from parsed JSON. Missing fields keep their defaults.
|
|
static func from_dict(data: Dictionary) -> CoverSource:
|
|
var result: CoverSource = CoverSource.new()
|
|
result.id = ApiJson.get_string(data, "id", "")
|
|
result.source = ApiJson.get_string(data, "source", "")
|
|
return result
|
|
|
|
|
|
## Returns the fields under their JSON names, ready for [method JSON.stringify].
|
|
func to_dict() -> Dictionary:
|
|
return {
|
|
"id": id,
|
|
"source": source,
|
|
}
|