Closed AnonTester closed 1 year ago
Thanks for this.
Properly handling the RuntimeError
raised by xbmc.Player
methods when playback ends is something that could be done in a more general manner, but it is a little bit more involved than using try/catch for each individual method call.
In this particular instance however, catching the exception is probably not quite the right fix. The actual code in get_next
that triggers the error should probably be changed to use the filename of the currently tracked video instead, as this avoids the potential for Unicode decode errors in Kodi 18, (using Python 2) and also allows the rest of the code to terminate normally if playback has stopped.
current_file = self.player.get_last_file()
Also there is no need to update the changelog and bump the version number, as that is done as part of a separate PR in order to trigger the release workflow.
@AnonTester - did you want to update this?
@MoojMidge adjusted to remove version and changelog and changing the try/catch which works for me with your suggestion instead.
Hmm looks like this uncovered a previous old issue - player.Player
was renamed to player.UpNextPlayer
but a number of the imports were not updated. Now importing player.Player
actually imports xbmc.player
rather than the new class.
Kudos, SonarCloud Quality Gate passed!
Fixes timing issue that sometimes pops up when stopping or forward skipping at end of movie/show just as UpNext is starting up resulting in error:
error: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--