Change soundtrack covers from the app and show the cover with the answer
Cover menu in the soundtrack popup ("Change cover"):
- Choose picture uploads a JPEG, PNG or WebP picture (up to 10 MB).
- Pick by ID uses a game's cover on SteamGridDB or an anime's on AniList.
- Remove cover deletes it, so the server searches for a new one.
- The server's reason is shown when it refuses a change.
After a change the new cover time is fetched, and the popup, the
statistics card and the quiz show the new cover.
Quiz: once the answer is shown, the soundtrack's cover shows to the left of
the titles. Cover and titles are centered together, left and right and up
and down, and each title keeps to two lines. Cover times come from the
soundtrack list, and songs keep their soundtrack's UUID, also in saves.
Requests can now send any body with its content type, and every 2xx answer
counts as success. Cover frames are 2:3 like the server's covers. Small
copies of real covers are used by the tests and screenshots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ef6ac8f1fd
commit
06421bb63e
33 files changed
+3966
-920
No files matched your search
@@ -25,9 +25,12 @@ var requested_paths: Array[String] = []
|
||||
var requested_methods: Array[int] = []
|
||||
## Headers of each request, in the same order as [member requested_paths].
|
||||
var requested_headers: Array[PackedStringArray] = []
|
||||
## The JSON body of each request, empty for none, in the same order as
|
||||
## The body of each request as text, e.g. its JSON, empty for none, in the same order as
|
||||
## [member requested_paths].
|
||||
var requested_bodies: Array[String] = []
|
||||
## The body of each request as bytes, e.g. an uploaded picture, in the same order as
|
||||
## [member requested_paths].
|
||||
var requested_raw_bodies: Array[PackedByteArray] = []
|
||||
## How many tokens have been asked for.
|
||||
var token_requests: int = 0
|
||||
## The JSON body of the last token request.
|
||||
@@ -110,20 +113,22 @@ func request(
|
||||
method: int,
|
||||
on_complete: Callable,
|
||||
headers: PackedStringArray = PackedStringArray(),
|
||||
body: String = "",
|
||||
body: PackedByteArray = PackedByteArray(),
|
||||
) -> void:
|
||||
var path: String = url.trim_prefix(Settings.default_path + MusicServerClient.API_PATH)
|
||||
if path == "/token" && method == HTTPClient.METHOD_POST:
|
||||
token_requests += 1
|
||||
if _held_paths.has(path):
|
||||
_held_paths[path].append(_answer_token_request.bind(body, on_complete))
|
||||
_held_paths[path].append(
|
||||
_answer_token_request.bind(body.get_string_from_utf8(), on_complete))
|
||||
return
|
||||
_answer_token_request(body, on_complete)
|
||||
_answer_token_request(body.get_string_from_utf8(), on_complete)
|
||||
return
|
||||
requested_paths.append(path)
|
||||
requested_methods.append(method)
|
||||
requested_headers.append(headers)
|
||||
requested_bodies.append(body)
|
||||
requested_bodies.append(body.get_string_from_utf8())
|
||||
requested_raw_bodies.append(body)
|
||||
if !OPEN_PATHS.has(path.get_slice("?", 0)) && !_has_valid_token(headers):
|
||||
on_complete.call(401, JSON.stringify({"error": "Unauthorized"}).to_utf8_buffer(),
|
||||
PackedStringArray())
|
||||
|
||||
Reference in new issue
Block a user