|
@@ -24,7 +24,9 @@ def update_media_root_for_import(file_path):
|
|
|
return suffix
|
|
|
|
|
|
|
|
|
-def import_gamelist_file_to_db_for_system(game_system_slug, file_path=None):
|
|
|
+def import_gamelist_file_to_db_for_system(
|
|
|
+ game_system_slug, file_path=None, full_scan=False
|
|
|
+):
|
|
|
imported_games = []
|
|
|
if not file_path:
|
|
|
file_path = os.path.join(settings.ROMS_DIR, game_system_slug, "gamelist.xml")
|
|
@@ -44,6 +46,11 @@ def import_gamelist_file_to_db_for_system(game_system_slug, file_path=None):
|
|
|
games = gamelist.findall("game")
|
|
|
for game in games:
|
|
|
name = game.find("name").text
|
|
|
+ obj, created = Game.objects.get_or_create(name=name)
|
|
|
+ if not created and not full_scan:
|
|
|
+ logger.info(f"Found game {game} and not doing full scan, so skipping")
|
|
|
+ continue
|
|
|
+
|
|
|
english_patched = "patched" in name.lower()
|
|
|
undub = "undub" in name.lower()
|
|
|
hack = "hack" in name.lower()
|
|
@@ -96,8 +103,6 @@ def import_gamelist_file_to_db_for_system(game_system_slug, file_path=None):
|
|
|
video_path = update_media_root_for_import(video_path_elem.text)
|
|
|
marquee_path = update_media_root_for_import(game.find("marquee").text)
|
|
|
|
|
|
- obj, created = Game.objects.get_or_create(name=name)
|
|
|
-
|
|
|
obj.game_system = game_system
|
|
|
obj.developer = developer
|
|
|
obj.publisher = publisher
|