Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrectly reported file size #52

Closed
Intel11 opened this issue Feb 14, 2019 · 5 comments
Closed

Incorrectly reported file size #52

Intel11 opened this issue Feb 14, 2019 · 5 comments

Comments

@Intel11
Copy link
Contributor

Intel11 commented Feb 14, 2019

Kodi 18.0
Retroarch 1.7.5
Windows 7 64 bits
IAGL: 2.0.7

Error in ROM Altered beast

image

image

In search: Altered beast

image

log in kodi:

10:53:13.070 T:2328  NOTICE: IAGL:  Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%201%20of%202%29%5B%21%5D.zip as logged in user
10:53:13.070 T:2328  NOTICE: IAGL:  Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip as logged in user
10:53:20.865 T:2328  NOTICE: IAGL:  File saved to location C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip, file size 295635, file crc 5D89AB34
10:53:20.873 T:2328  NOTICE: IAGL:  Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%202%20of%202%29%5B%21%5D.zip as logged in user
10:53:20.873 T:2328  NOTICE: IAGL:  Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 2 of 2)[!].zip as logged in user
10:53:24.943 T:2328  NOTICE: IAGL:  File saved to location C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 2 of 2)[!].zip, file size 305668, file crc 9CCE096
10:53:25.019 T:2328  NOTICE: IAGL:  Sending Launch Command: "C:\temp\retro\retroarch.exe"  -L "C:\temp\retro\cores\hatari_libretro.dll" "C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered_Beast\Altered Beast (1989)(Activision).m3u"
10:54:04.149 T:5172  NOTICE: IAGL:  Lets Play!

Error in size game?

image

Thank you

zach-morris added a commit that referenced this issue Feb 15, 2019
Add logging around issue described in #52
@zach-morris
Copy link
Owner

zach-morris commented Feb 15, 2019

Well, thats pretty weird. I do not get the same response from my computer when I download this game. The way the file size and progress estimating thing works is:

  • The file size is listed in the game list xml file, since it in general is known before download (but not always)
  • When you start a download, depending on the game file / location / etc the source (archive.org) may provide a size of the file requested.
  • If the source provides a size of the file, then I'll use that on the download progress, if it doesn't then I'll use whats listed in the game list.

It seems like archive.org is returning a garbage filesize for you, although I'm not sure why. When I try, it doesn't provide a filesize, so the one listed in the game list is used, which is correct. I've added some more debug logging around this to see if I can make it smarter in the future.

@zach-morris zach-morris changed the title ROM Altered beast error Incorrectly reported file size Feb 15, 2019
@Intel11
Copy link
Contributor Author

Intel11 commented Feb 15, 2019

Hi, thanks for answering.

I downloaded the file: main.py to try.

And in the log of kodi does not keep what you have changed:

xbmc.log(msg='IAGL: Source URL returned filesize of %(header_size)s'%{'header_size': header_filesize}, level=xbmc.LOGDEBUG)

17:57:32.115 T:7012 NOTICE: IAGL: Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%201%20of%202%29%5B%21%5D.zip as logged in user 17:57:32.115 T:7012 NOTICE: IAGL: Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip as logged in user 17:57:36.150 T:7012 NOTICE: IAGL: File saved to location C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip, file size 295635, file crc 5D89AB34 17:57:36.162 T:7012 NOTICE: IAGL: Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%202%20of%202%29%5B%21%5D.zip as logged in user 17:57:36.162 T:7012 NOTICE: IAGL: Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 2 of 2)[!].zip as logged in user 17:57:40.312 T:7012 NOTICE: IAGL: File saved to location C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 2 of 2)[!].zip, file size 305668, file crc 9CCE096 17:57:40.388 T:7012 NOTICE: IAGL: Sending Launch Command: "C:\temp\retro\retroarch.exe" -L "C:\temp\retro\cores\hatari_libretro.dll" "C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered_Beast\Altered Beast (1989)(Activision).m3u"

@zach-morris
Copy link
Owner

zach-morris commented Feb 15, 2019

You need to turn on debug logging in Kodi first (see #2 here), in the Kodi system settings. My setup returns:

5:22:31.746 T:123145473777664   DEBUG: IAGL:  Source URL returned no filesize, current size estimate is 295635
...
15:22:33.264 T:123145473777664   DEBUG: IAGL:  Source URL returned no filesize, current size estimate is 305668

@Intel11
Copy link
Contributor Author

Intel11 commented Feb 16, 2019

Hi, I still get the wrong sizes, this is the new log:

09:37:43.949 T:6676   ERROR: CGUIMediaWindow::GetDirectory(plugin://plugin.program.iagl/game/Atari_ST_ZachMorris/Altered+Beast) failed
09:38:23.011 T:4076  NOTICE: IAGL:  Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%201%20of%202%29%5B%21%5D.zip as logged in user
09:38:23.011 T:4076  NOTICE: IAGL:  Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip as logged in user
09:38:23.344 T:6676  NOTICE: Log level changed to "LOG_LEVEL_DEBUG_FREEMEM"
09:38:23.344 T:6676  NOTICE: Enabled debug logging due to GUI setting. Level 2.
09:38:23.344 T:6676  NOTICE: Log level changed to "LOG_LEVEL_DEBUG_FREEMEM"
09:38:23.344 T:6676  NOTICE: Enabled debug logging due to GUI setting. Level 2.
09:38:27.063 T:4076   DEBUG: IAGL:  Source URL returned no filesize, current size estimate is 295635
09:38:28.580 T:4076  NOTICE: IAGL:  File saved to location C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip, file size 295635, file crc 5D89AB34
09:38:28.594 T:4076   DEBUG: IAGL:  Checking downloaded file C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 1 of 2)[!].zip validity
09:38:28.594 T:4076   DEBUG: IAGL:  File validity check passed.
09:38:28.594 T:4076  NOTICE: IAGL:  Attempting to download file http://archive.org/download/Atari_ST_TOSEC_2012_04_23/Atari_ST_TOSEC_2012_04_23.zip/Atari%20ST%20%5BTOSEC%5D%2FGames%2FAtari%20ST%20-%20Games%20-%20%5BSTX%5D%20%28TOSEC-v2011-03-20_CM%29%2FAltered%20Beast%20%281989%29%28Activision%29%28Disk%202%20of%202%29%5B%21%5D.zip as logged in user
09:38:28.594 T:4076  NOTICE: IAGL:  Saving file to C:\Users\admin1\AppData\Roaming\Kodi\userdata\addon_data\plugin.program.iagl\temp_iagl\Altered Beast (1989)(Activision)(Disk 2 of 2)[!].zip as logged in user
09:38:28.594 T:4076   DEBUG: DialogProgress::Open called (already running)!
09:38:31.384 T:4076   DEBUG: IAGL:  Source URL returned no filesize, current size estimate is 305668

image

image

@zach-morris
Copy link
Owner

OK, I figured it out. Python request module can vary the size of the chunk downloaded. Should work now. Thanks for all the debug info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants