From 8fd159d2feddebb9589f40421a0cbd54c2a03d0f Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Fri, 12 Jan 2018 12:34:07 -0800 Subject: [PATCH] Use added_at to check recently added more than 24 hours ago --- plexpy/activity_handler.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plexpy/activity_handler.py b/plexpy/activity_handler.py index 484e2048..93673a59 100644 --- a/plexpy/activity_handler.py +++ b/plexpy/activity_handler.py @@ -500,14 +500,16 @@ def on_created(rating_key, **kwargs): notify = True now = int(time.time()) - if helpers.cast_to_int(metadata['updated_at']) < now - 86400: # Updated more than 24 hours ago - logger.debug(u"Tautulli TimelineHandler :: Library item %s updated more than 24 hours ago. Not notifying." % str(rating_key)) + if helpers.cast_to_int(metadata['added_at']) < now - 86400: # Updated more than 24 hours ago + logger.debug(u"Tautulli TimelineHandler :: Library item %s added more than 24 hours ago. Not notifying." + % str(rating_key)) notify = False data_factory = datafactory.DataFactory() if 'child_keys' not in kwargs: if data_factory.get_recently_added_item(rating_key): - logger.debug(u"Tautulli TimelineHandler :: Library item %s added already. Not notifying again." % str(rating_key)) + logger.debug(u"Tautulli TimelineHandler :: Library item %s added already. Not notifying again." + % str(rating_key)) notify = False if notify: