Browse Source

Fix output of import task

Colin Powell 3 years ago
parent
commit
d9bcbb723d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      games/tasks.py

+ 7 - 1
games/tasks.py

@@ -5,10 +5,16 @@ from games.utils import import_gamelist_file_to_db_for_system, skyscrape_console
 
 @shared_task
 def update_roms(game_system_slugs: list, full_scan=False):
-    import_dict = {"imported": 0, "not_imported": 0}
+    import_dict = {"imported": [], "not_imported": []}
     for game_system_slug in game_system_slugs:
         skyscrape_console(game_system_slug)
         import_dict = import_gamelist_file_to_db_for_system(
             game_system_slug, full_scan=full_scan
         )
+    if import_dict["imported"]:
+        import_dict["imported"] = [game.name for game in import_dict["imported"]]
+    if import_dict["not_imported"]:
+        import_dict["not_imported"] = [
+            game.name for game in import_dict["not_imported"]
+        ]
     print(import_dict)