From e25c18bb20a7c4064d83c0cf3634c5226f31d397 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 15 Mar 2021 12:01:41 -0700 Subject: [PATCH] Fix if library watch time stats are blocked for guest access --- plexpy/datafactory.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 6ee1619d..573ae104 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- # This file is part of Tautulli. # @@ -909,7 +909,7 @@ class DataFactory(object): for item in result: library_item = library_data.get_watch_time_stats(section_id=item['section_id'], grouping=None , query_days=time_range) - if library_item[0]['total_plays'] == 0 and library_item[0]['total_time'] == 0: + if not library_item or library_item[0]['total_plays'] == 0 and library_item[0]['total_time'] == 0: continue if item['custom_thumb'] and item['custom_thumb'] != item['library_thumb']: