@@ -2860,21 +2860,20 @@ def _command_edit_rom(self, categoryID, launcherID, romID):
28602860 scraper_index = mindex2 - len(common_menu_list)
28612861 scraper_ID = g_scrap_factory.get_metadata_scraper_ID_from_menu_idx(scraper_index)
28622862
2863- # --- Grab data ---
2864- object_dic = roms[romID]
2865- ROM = FileName(roms[romID]['filename'])
2863+ # Prepare data for scraping.
2864+ rom = roms[romID]
2865+ ROM_FN = FileName(rom['filename'])
2866+ if rom['disks']:
2867+ ROM_hash_FN = FileName(ROM_FN.getDir()).pjoin(rom['disks'][0])
2868+ else:
2869+ ROM_hash_FN = ROM_FN
28662870 if categoryID == VCATEGORY_FAVOURITES_ID or categoryID == VCATEGORY_COLLECTIONS_ID:
2867- platform = roms[romID] ['platform']
2871+ platform = rom ['platform']
28682872 else:
28692873 platform = self.launchers[launcherID]['platform']
2870- if roms[romID]['disks']:
2871- # Multidisc ROM. Take first file of the set.
2872- ROM_checksums_FN = FileName(ROM.getDir()).pjoin(roms[romID]['disks'][0])
2873- else:
2874- ROM_checksums_FN = ROM
28752874 data_dic = {
2876- 'rom_FN ' : ROM ,
2877- 'rom_checksums_FN ' : ROM_checksums_FN ,
2875+ 'ROM_FN ' : ROM_FN ,
2876+ 'ROM_hash_FN ' : ROM_hash_FN ,
28782877 'platform' : platform,
28792878 }
28802879
@@ -2886,7 +2885,7 @@ def _command_edit_rom(self, categoryID, launcherID, romID):
28862885 # Remember to flush caches after scraping.
28872886 st_dic = kodi_new_status_dic()
28882887 s_strategy = g_scrap_factory.create_CM_metadata(scraper_ID, platform)
2889- s_strategy.scrap_CM_metadata_ROM(object_dic , data_dic, st_dic)
2888+ s_strategy.scrap_CM_metadata_ROM(rom , data_dic, st_dic)
28902889 g_scrap_factory.destroy_CM()
28912890 if kodi_display_status_message(st_dic): return
28922891
@@ -3000,9 +2999,7 @@ def _command_edit_rom(self, categoryID, launcherID, romID):
30002999 ROM_hash_FN = FileName(ROM_FN.getDir()).pjoin(rom['disks'][0])
30013000 else:
30023001 ROM_hash_FN = ROM_FN
3003- if categoryID == VCATEGORY_FAVOURITES_ID:
3004- platform = rom['platform']
3005- elif categoryID == VCATEGORY_COLLECTIONS_ID:
3002+ if categoryID == VCATEGORY_FAVOURITES_ID or categoryID == VCATEGORY_COLLECTIONS_ID:
30063003 platform = rom['platform']
30073004 else:
30083005 platform = self.launchers[launcherID]['platform']
0 commit comments