maloep / romcollectionbrowser

Kodi - Rom Collection Browser
GNU General Public License v2.0
82 stars 29 forks source link

Shell launcher fails to launch uncompressed roms: "local variable 'precmd' referenced before assignment" #439

Open grnassar opened 3 years ago

grnassar commented 3 years ago

Trying to launch a game on Kodi Matrix without using Retroplayer fails for cases where the file isn't compressed. (Guessing compressed files work fine though I did not test that; why I think this will be clear shortly)

Kodi log shows error thrown by Python; traceback points to cmd_launcher.py, line 115 with error "local variable 'precmd' referenced before assignment".

Upon further inspection, build_cmd is being passed an empty roms array by code in base_launcher.py. Looking at commits it seems this was likely still working fine after the first refactor commit, but broke on the last one. Prior to the last commit, archivehandler's extract_archive function was getting passed all filenames, archived or not. It handled the base case with a simple initial assignment of the roms array, and then clobbered it later with any extracted files if necessary. After the April 15 commit, however, extract_archive is contingent on is_archive==true and does not run otherwise. Makes more sense that way, but the base case never got moved to be handled by the calling function.

Pretty simple fix, I think; have a pull request coming for you in just a few.

grnassar commented 3 years ago

Pull request submitted. First time doing that with the new github app; hope I did that right!