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

Error while autoplay next item #377

Closed
2 of 5 tasks
Goommer opened this issue Dec 8, 2019 · 9 comments
Closed
2 of 5 tasks

Error while autoplay next item #377

Goommer opened this issue Dec 8, 2019 · 9 comments
Labels

Comments

@Goommer
Copy link

Goommer commented Dec 8, 2019

Addon used

  • Amazon VOD (plugin.video.amazon-test)
  • Amazon (plugin.video.amazon)
  • Browser Launcher (plugin.program.browser.launcher)
  • Addon Version 0.8.1~beta

Prime Video Account (select one)

  • primevideo.com
  • amazon.(com/co.uk/de/jp)

System Setup (please provide the following information):

  • Hardware: x86_64
  • OS Version: GNU/Linux Debian
  • Kodi Version: 19.0-ALPHA1

Upload Logs
kodi.log

Describe the bug
An error occurs when playing the next item when auto play is set
the failure occurs from commit 6af0716, undoing those changes solves the problem

Settings->Player->Videos->Play next video automatically->Uncategorized
In config file guisettings.xml:
<setting id="videoplayer.autoplaynextitem">4</setting>

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
           - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
          Error Type: <class 'TypeError'>
          Error Contents: '>' not supported between instances of 'NoneType' and 'int'
          Traceback (most recent call last):
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/default.py", line 5, in <module>
              EntryPoint()
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/resources/lib/startup.py", line 80, in EntryPoint
              PlayVideo(args.get('name', ''), args.get('asin'), args.get('adult', '0'), int(args.get('trailer', '0')), int(args.get('selbitrate', '0')))
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/resources/lib/playback.py", line 479, in PlayVideo
              playable = _IStreamPlayback(asin, name, streamtype, isAdult, extern)
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/resources/lib/playback.py", line 446, in _IStreamPlayback
              player.resolve(listitem)
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/resources/lib/playback.py", line 622, in resolve
              if self.extern and not self.checkResume():
            File "/home/goommer/.kodi/addons/plugin.video.amazon-test/resources/lib/playback.py", line 649, in checkResume
              if self.resume > 180 and self.extern:
          TypeError: '>' not supported between instances of 'NoneType' and 'int'
          -->End of Python script error report<--
@Sandmann79
Copy link
Owner

By means of these commits, the extern variable is correctly initialized and thus the resume point is also checked. This is available but apparently empty.
This will be fixed soon.

@Varstahl
Copy link
Collaborator

Varstahl commented Dec 8, 2019

Can confirm for PV too, not sure if it started with 0.8.0 or 0.7.9 though.

@Varstahl Varstahl added the bug label Dec 8, 2019
@Sandmann79
Copy link
Owner

It's just a missing default value at line 665

@Goommer
Copy link
Author

Goommer commented Dec 8, 2019

It's just a missing default value at line 665

That's right
With this patch I have solved the problem momentarily until you publish the final

--- a/plugin.video.amazon-test/resources/lib/playback.py
+++ b/plugin.video.amazon-test/resources/lib/playback.py
@@ -662,7 +662,8 @@ class _AmazonPlayer(xbmc.Player):
             return {}
         with co(self.resumedb, 'rb') as fp:
             items = pickle.load(fp)
-            self.resume = items.get(self.asin, {}).get('resume')
+            resume = items.get(self.asin, {}).get('resume')
+            self.resume = 0 if None is resume else resume
             fp.close()
         return items
 

Thanks a lot

@Varstahl
Copy link
Collaborator

Varstahl commented Dec 8, 2019

It could be simplified to

self.resume = items.get(self.asin, {}).get('resume') or 0

Works for both py27 and py3. I'll test it now.

@Goommer
Copy link
Author

Goommer commented Dec 8, 2019

much better

Thanks a lot

@Sandmann79
Copy link
Owner

You can also use this line:
self.resume = items.get(self.asin, {}).get('resume', 0)

@Varstahl
Copy link
Collaborator

Varstahl commented Dec 8, 2019

Whops, that's even better, but I need to revert the last 2 commits, lol…

Varstahl added a commit that referenced this issue Dec 8, 2019
@Varstahl
Copy link
Collaborator

Varstahl commented Dec 8, 2019

Facepalm aside, amended with c16998b.

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

No branches or pull requests

3 participants