romcollectionbrowser icon indicating copy to clipboard operation
romcollectionbrowser copied to clipboard

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

Open grnassar opened this issue 3 years ago • 1 comments

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 avatar Jul 15 '21 18:07 grnassar

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

grnassar avatar Jul 15 '21 18:07 grnassar