zSeriesGuy / Tautulli

A Python based monitoring and tracking tool for Plex Media Server.
http://tautulli.com
GNU General Public License v3.0
27 stars 9 forks source link

Tautulli Web Interface breaks when playing trailers/extras/etc (All content with no ID) #38

Closed ExDominatus closed 4 years ago

ExDominatus commented 4 years ago

Version: V4.1.01

Branch: master

Operating system: Linux (Debian Buster)

Python version: 3.7.3

What you did? 1) Play trailer or extra or enable Theme Music in Plex client side. 2) Tautulli dashboard will break, with no cards showing and the following message:

There was an error communicating with your Plex Server. Check the logs and verify your server connection in the settings.

What happened? Tautulli seems to be unable to parse non-movie, non TV show content that is being played from Plex's agents and has no database entry.

What you expected? Tautulli should either a) Properly handle and display these sessions (Extremely hard) b) Filter out these sessions so that the rest of the dashboard doesn't break.

Here is how a link to the original Tautulli commit where it's filtering out background theme music sessions: https://github.com/Tautulli/Tautulli/commit/master?short_path=4ac32a7&unchanged=expanded

It could possibly be solved by checking for duration, if possible?

Log Errors:

Tautulli WebSocket :: Serrver1: Failed to process session data: invalid literal for int() with base 10: ''.

WebUI :: /home : Uncaught TypeError: Cannot read property 'error' of null. (jquery.dataTables.min.js:35)


Traceback (most recent call last):
  File "/home/username/apps/Tautulli/plexpy/webserve.py", line 5315, in get_server_status
      server_status = plexpy.PMS_SERVERS.get_server_status()
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 177, in get_server_status
      server_status['data'].append(server.get_server_status())
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 444, in get_server_status
      server_status.update(self.get_activity())
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 467, in get_activity
      activity = self.get_current_activity()
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 2169, in get_current_activity
      session_output = self.get_session_each(session_)
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 2566, in get_session_each
      metadata_details = self.get_metadata_details(rating_key=rating_key, cache_key=session_key)
  File "/home/username/apps/Tautulli/plexpy/servers.py", line 1317, in get_metadata_details
      result = monitor_db.select_single(query, args=[self.CONFIG.ID, int(section_id)])
ValueError: invalid literal for int() with base 10: ''```

I have been absolutely loving this fork so far and this is the one thing that constantly causes it to break.
zSeriesGuy commented 4 years ago

Thank you for reporting this. Sorry about the problem. I will look into it in the next day or two. I'll let you know when code is ready.

ExDominatus commented 4 years ago

No worries at all. Thank you for looking into it and no need to be sorry at all.

You have done some incredible work with this fork, and let me know if you have a Paypal/Patreon or whatever, I'd like to buy you a beer (or 6!) to show you my appreciation.

zSeriesGuy commented 4 years ago

I just published a release that should fix the issue. Let me know if it resolved it for you. Thank you for the beer offer. :) I just wish I could incorporate this fork into the original product without having to completely rewrite them.

ExDominatus commented 4 years ago

Thank you SO much <3. It works flawlessly. Tested with Plex trailers, Plex extras, local extras, and theme music.

And yes, this fork has been such a godsend for me when trying to manage my local server + seedbox server, and simplifying everything into one solution.