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

Fix uncaught exception in Player.report_playback() #791

Merged
merged 2 commits into from Feb 7, 2024

Conversation

pdf
Copy link
Contributor

@pdf pdf commented Nov 21, 2023

I see regular exceptions thrown in Player.report_playback(), as below:

2023-11-19 21:32:20.858 T:1220    error <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                                    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                                   Error Type: <class 'RuntimeError'>
                                                   Error Contents: Kodi is not playing any media file
                                                   Traceback (most recent call last):
                                                     File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/player.py", line 308, in onPlayBackSeek
                                                       self.report_playback()
                                                     File "/storage/.kodi/addons/plugin.video.jellyfin/jellyfin_kodi/player.py", line 352, in report_playback
                                                       item['CurrentPosition'] = int(self.getTime())
                                                                                     ^^^^^^^^^^^^^^
                                                   RuntimeError: Kodi is not playing any media file
                                                   -->End of Python script error report<--

This is not entirely unsurprising, since this method is called from numerous places, and in at least one case is called with a delay, meaning that media playback may have completed before the method is called.

Copy link

sonarcloud bot commented Nov 21, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link

codecov bot commented Nov 27, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e95e8d6) 21.51% compared to head (248b49c) 21.50%.
Report is 24 commits behind head on master.

Files Patch % Lines
jellyfin_kodi/player.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #791      +/-   ##
==========================================
- Coverage   21.51%   21.50%   -0.02%     
==========================================
  Files          63       63              
  Lines        8542     8546       +4     
  Branches     1572     1572              
==========================================
  Hits         1838     1838              
- Misses       6680     6686       +6     
+ Partials       24       22       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

jellyfin_kodi/player.py Outdated Show resolved Hide resolved
@oddstr13 oddstr13 added the bugfix label Feb 6, 2024
Copy link

sonarcloud bot commented Feb 7, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@oddstr13 oddstr13 merged commit 3a58d34 into jellyfin:master Feb 7, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants