Skip to content

Commit 261f974

Browse files
committed
chore: add a few more download debug messages
1 parent db5b4d9 commit 261f974

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

scripts/download_song_from_url/download_song_from_url.gml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function download_song_from_url() {
2121
}
2222
} else if (status == 0) {
2323
// Download was interrupted, may have been successful or not (if connection was interrupted)
24+
show_debug_message("Download interrupted; may have been successful our not");
2425
song_download_data = -1;
2526
song_download_status = 0;
2627

@@ -36,12 +37,14 @@ function download_song_from_url() {
3637
contentType = headers[? "Content-Type"];
3738
}
3839
var writtenFileSize = file_get_size(song_download_file);
40+
show_debug_message("Written file size: " + string(writtenFileSize));
3941

4042
// Check mimetype to see if response is a valid file
4143
var invalid_type = false;
4244
if (!is_undefined(contentType)) {
4345
if !(contentType == "application/zip" || contentType == "application/octet-stream") {
4446
invalid_type = true
47+
show_debug_message("Invalid file type");
4548
}
4649
}
4750

@@ -56,6 +59,7 @@ function download_song_from_url() {
5659
}
5760

5861
if (!invalid_type && contentLength > 0 && writtenFileSize == contentLength) {
62+
show_debug_message("Download complete!");
5963
song_downloaded_size = song_total_size; // prevent freezing under 100%
6064
show_debug_message(override_fn);
6165
load_song(song_download_file, true); // load as backup file (keep unsaved, don't add to recent etc.)

scripts/download_song_start/download_song_start.gml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ function download_song_start(download_url) {
3131
song_download_display_name = string_copy(download_url_noparams, string_last_pos("/", download_url_noparams) + 1, string_length(download_url_noparams));
3232

3333
// Init download
34+
show_debug_message(string(song_download_data));
3435
song_download_data = http_get_file(download_url, song_download_file);
36+
show_debug_message(string(song_download_data));
3537

3638
}
3739
}

0 commit comments

Comments
 (0)