mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Remember previous recently added items
* Only pull metadata if there are new recently added items since the last check
This commit is contained in:
parent
ef6ef98541
commit
bb5aa2be3d
1 changed files with 7 additions and 1 deletions
|
@ -22,6 +22,7 @@ import time
|
|||
monitor_lock = threading.Lock()
|
||||
ext_ping_count = 0
|
||||
int_ping_count = 0
|
||||
prev_keys = [0] * 10
|
||||
|
||||
|
||||
def check_active_sessions(ws_request=False):
|
||||
|
@ -191,7 +192,12 @@ def check_recently_added():
|
|||
recently_added_list = pms_connect.get_recently_added_details(count='10')
|
||||
|
||||
if recently_added_list:
|
||||
recently_added = recently_added_list['recently_added']
|
||||
new_recently_added = recently_added_list['recently_added']
|
||||
|
||||
global prev_keys
|
||||
new_keys = [item['rating_key'] for item in new_recently_added]
|
||||
recently_added = [new_recently_added[i] for i, x in enumerate(new_keys) if x != prev_keys[i]]
|
||||
prev_keys = new_keys
|
||||
|
||||
for item in recently_added:
|
||||
metadata = []
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue