#8: Added functionality to cache more than one song
All checks were successful
Build / build (push) Successful in 1m25s

This commit is contained in:
2025-10-26 20:48:35 +01:00
parent 4e6e37775d
commit 734a463db9
13 changed files with 327 additions and 139 deletions

View File

@@ -7,6 +7,8 @@ var selected_server: int = 0
var is_local: bool = false
var is_debug: bool = false
var stop_after_current: bool = true
var auto_repeat_song: bool = false
var hide_next_track: bool = true
@@ -14,14 +16,9 @@ var add_to_stats: bool = true
var use_low_played_mode: bool = false
var winning_score: int = 20
var fullscreen: bool = false
var quick_sync: bool = true
var number_of_tracks_to_preload: int = 1
var play_local: bool = false
var player_array: Array[PlayerObject]
var song_object_array: Array[SongObject] = []
var latest_played_song: int = 0
var currently_playing_song: int = -1
var edit_players: bool = false
var currently_syncing: bool = false
@@ -29,15 +26,16 @@ var version: String = "1.6.0"
var whats_new: String = "Changelog:
1.6.0:
#1: Fixed bug with inspiration list not reloding after sync
#1: Fixed bug with inspiration list not reloading after sync
#2: New dialog for sync
#6: Now show progress during sync
#7: Blocking all requests to the server during sync
#8: Added functionality to cache more than one song
1.5.0: Made big changes to players and the song list and how the local song list works
0.9.0-Beta: Fixed settings and updated the player view
0.8.0-Beta: Fixed reset buttons and some other small things
0.7.8-Beta: Added shortcuts. Added dialog for winner. Started cleaning code.
0.7.5-Beta: Added settings menu, most things don't do anythig yet
0.7.5-Beta: Added settings menu, most things don't do anything yet
0.7-Beta: Can now hop between songs"
var whats_left: String = "Things left to do:
@@ -105,6 +103,21 @@ func make_request3(address: String) -> void:
var request_error: int = http_request.request(default_path + address)
if request_error != OK:
push_error("An error occurred in the HTTP request.")
func make_put_request(address: String) -> void:
var error_handling: Callable = func(_result: int, response_code: int, _headers: PackedStringArray, _body: PackedByteArray) -> void:
print("request done to address: ", default_path + address)
if response_code != 200:
print("Error: " + str(response_code))
var http_request: HTTPRequest = HTTPRequest.new()
add_child(http_request)
http_request.request_completed.connect(error_handling)
# Perform a GET request. The URL below returns JSON as of writing.
var headers: PackedStringArray = ["Content-Type: application/json"]
var request_error: int = http_request.request(default_path + address, headers, HTTPClient.METHOD_PUT)
if request_error != OK:
push_error("An error occurred in the HTTP request.")
func delete_children(node: Node) -> void:
for n: Node in node.get_children():
@@ -122,7 +135,3 @@ func delete_player_children(node: Node) -> void:
else:
node.remove_child(n)
n.queue_free()
func unset_is_playing() -> void:
for song_object: SongObject in song_object_array:
song_object.is_playing = false