From 7b920208a461af6741d8bce7de78a6dc5ade3551 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 15 Mar 2021 14:01:23 -0700 Subject: [PATCH] Add limit 1 when retrieving library last play --- plexpy/datafactory.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plexpy/datafactory.py b/plexpy/datafactory.py index 517e3d03..6b62d4b5 100644 --- a/plexpy/datafactory.py +++ b/plexpy/datafactory.py @@ -916,7 +916,8 @@ class DataFactory(object): if not library_item or library_item[0]['total_plays'] == 0 and library_item[0]['total_time'] == 0: continue - library_watched = library_data.get_recently_watched(section_id=item['section_id']) + library_watched = library_data.get_recently_watched(section_id=item['section_id'], + limit='1') last_play = library_watched[0]['time'] if library_watched else 0 if item['custom_thumb'] and item['custom_thumb'] != item['library_thumb']: