@@ -179,6 +179,9 @@ func thread_fetch_game_entries():
179
179
else :
180
180
game_entry .description = "Fetching media (by search)..."
181
181
call_thread_safe ("emit_signal" , "scrape_step" , game_entry )
182
+ # FIXME: Refactor this code ASAP it's so bad
183
+ if game_entry .data is Array :
184
+ game_entry .data = game_data .name .get_basename ()
182
185
if not scraper .scrape_game_by_search (game_data , game_entry .data ):
183
186
pending_datas [game_data ] = req
184
187
Request .Type .MEDIA :
@@ -260,7 +263,6 @@ func t_on_game_scrape_not_found(game_data: RetroHubGameData):
260
263
call_deferred ("incr_num_games_error" )
261
264
262
265
263
-
264
266
func t_on_game_scrape_error (game_data : RetroHubGameData , details : String ):
265
267
var req : Request = _ensure_valid_req (game_data )
266
268
if not req :
@@ -466,7 +468,7 @@ func _on_Warning_search_completed(orig_game_data: RetroHubGameData, new_game_dat
466
468
break
467
469
468
470
func cancel_scrape (game_entry : RetroHubScraperGameEntry ):
469
- game_entry .data = ["Canceled" , null ]
471
+ game_entry .data = ["Canceled" , game_entry . data if game_entry . data is String else null ]
470
472
game_entry .state = RetroHubScraperGameEntry .State .ERROR
471
473
num_games_pending = num_games_pending - 1
472
474
num_games_error = num_games_error + 1
@@ -523,7 +525,7 @@ func cancel_entry(game_entry: RetroHubScraperGameEntry):
523
525
# warning-ignore:return_value_discarded
524
526
requests_semaphore .wait ()
525
527
requests_mutex .unlock ()
526
- game_entry .data = ["Canceled" , null ]
528
+ game_entry .data = ["Canceled" , game_entry . data if game_entry . data is String else null ]
527
529
game_entry .state = RetroHubScraperGameEntry .State .ERROR
528
530
num_games_pending -= 1
529
531
num_games_error += 1
@@ -562,11 +564,14 @@ func _on_StopScraperDialog_confirmed():
562
564
finish_scraping ()
563
565
564
566
565
- func _on_Error_retry_entry (game_entry : RetroHubScraperGameEntry , req : Request ):
567
+ func _on_Error_retry_entry (game_entry : RetroHubScraperGameEntry , req ):
566
568
requests_mutex .lock ()
567
569
if req == null :
568
570
# No request, so start by scratch
569
571
add_data_request (game_entry , Request .Type .DATA_HASH if scrape_by_hash else Request .Type .DATA_SEARCH , true )
572
+ elif req is String :
573
+ game_entry .data = req
574
+ add_data_request (game_entry , Request .Type .DATA_SEARCH , true )
570
575
else :
571
576
requests_queue .push_front (req )
572
577
# warning-ignore:return_value_discarded
0 commit comments