mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-11 15:56:07 -07:00
Fix recently added using added at time
This commit is contained in:
parent
bb5aa2be3d
commit
8c4292f9ac
1 changed files with 15 additions and 20 deletions
|
@ -22,7 +22,6 @@ 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):
|
||||
|
@ -192,16 +191,12 @@ def check_recently_added():
|
|||
recently_added_list = pms_connect.get_recently_added_details(count='10')
|
||||
|
||||
if recently_added_list:
|
||||
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
|
||||
recently_added = recently_added_list['recently_added']
|
||||
|
||||
for item in recently_added:
|
||||
metadata = []
|
||||
|
||||
if 0 < time_threshold - int(item['added_at']) <= time_interval:
|
||||
if item['media_type'] == 'movie':
|
||||
metadata_list = pms_connect.get_metadata_details(item['rating_key'])
|
||||
if metadata_list:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue