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']: