Short songs (#30): a quiz settings switch and a Seconds per song row (30 by default, 10-120 in steps of 5), saved with the quiz settings. Only part of each quiz song plays, from a random point 10-60% into it, picked once per song so restart and repeat play the same part. The progress bar, time and seeking stay within the part, a hidden beginning counts inside it, and its end counts as the song ending (repeat, stop or go to the next song as set). Random songs (#51): the low-played switch in Settings is now a Normal / Low played / Classic choice, stored as Settings.random_mode and not saved. fetch_random_song(mode) picks /music/rand, /music/rand/low or /music/rand/classic. Closes #30 Closes #51 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0fc3be79e1
commit
a735c515bf
20 files changed
+1325
-327
No files matched your search
@@ -59,16 +59,16 @@ func test_json_list_that_is_not_an_array_calls_on_failed() -> void:
|
||||
assert_array(outcome).contains_exactly(["failed"])
|
||||
|
||||
|
||||
func test_fetch_random_song_uses_normal_endpoint() -> void:
|
||||
MusicServerClient.fetch_random_song(false, func(_body: PackedByteArray) -> void: pass)
|
||||
@warning_ignore("unused_parameter")
|
||||
func test_fetch_random_song_uses_the_endpoint_of_its_mode(mode: Settings.RandomMode,
|
||||
path: String, test_parameters: Array = [
|
||||
[Settings.RandomMode.NORMAL, "/music/rand"],
|
||||
[Settings.RandomMode.LOW_PLAYED, "/music/rand/low"],
|
||||
[Settings.RandomMode.CLASSIC, "/music/rand/classic"],
|
||||
]) -> void:
|
||||
MusicServerClient.fetch_random_song(mode, func(_body: PackedByteArray) -> void: pass)
|
||||
|
||||
assert_array(_server.requested_paths).contains_exactly(["/music/rand"])
|
||||
|
||||
|
||||
func test_fetch_random_song_uses_low_played_endpoint() -> void:
|
||||
MusicServerClient.fetch_random_song(true, func(_body: PackedByteArray) -> void: pass)
|
||||
|
||||
assert_array(_server.requested_paths).contains_exactly(["/music/rand/low"])
|
||||
assert_array(_server.requested_paths).contains_exactly([path])
|
||||
|
||||
|
||||
func test_fetch_song_passes_raw_bytes() -> void:
|
||||
@@ -103,7 +103,7 @@ func test_failed_request_calls_on_failed() -> void:
|
||||
_server.respond_bytes("/music/rand", PackedByteArray(), 503)
|
||||
var outcome: Array[String] = []
|
||||
|
||||
MusicServerClient.fetch_random_song(false,
|
||||
MusicServerClient.fetch_random_song(Settings.RandomMode.NORMAL,
|
||||
func(_body: PackedByteArray) -> void: outcome.append("done"),
|
||||
func() -> void: outcome.append("failed"))
|
||||
|
||||
@@ -370,8 +370,6 @@ func test_delete_token_without_token_sends_nothing() -> void:
|
||||
func test_endpoint_paths_and_methods() -> void:
|
||||
var noop: Callable = func(_data: Variant = null) -> void: pass
|
||||
var calls: Array[Array] = [
|
||||
[func() -> void: MusicServerClient.fetch_random_song_classic(noop),
|
||||
"/music/rand/classic", HTTPClient.METHOD_GET],
|
||||
[func() -> void: MusicServerClient.fetch_next_song(noop),
|
||||
"/music/next", HTTPClient.METHOD_GET],
|
||||
[func() -> void: MusicServerClient.fetch_previous_song(noop),
|
||||
|
||||
Reference in new issue
Block a user