zach-morris / plugin.program.iagl

The Internet Archive Game Launcher (IAGL) will launch Games from the Internet using Kodi
GNU General Public License v3.0
344 stars 49 forks source link

Games with period in title are always re-downloaded #241

Closed tonywagner closed 1 year ago

tonywagner commented 2 years ago

I noticed that games with a period in the title and file name (like a certain series of "Bros." games :) ) were always re-downloading, even though they already existed in my download path.

Looks like the problem is this line, under the "get_game_download_dict" definition of utils.py:

'filename_no_ext':game_filename.split('.')[0],

Unfortunately that discards everything after the first period in the filename, rather than just the extension! So the "matching_existing_files" comparison would always fail on these files, even if they existed.

"os.path.splitext" is the more appropriate function to determine the file name without the extension. So this issue can be solved by changing the above line to the following:

'filename_no_ext':os.path.splitext(game_filename)[0],

zach-morris commented 2 years ago

Thanks for this report and finding the isssue

zach-morris commented 2 years ago

Fix with latest commit. Will be included in next release