From de58136314094394846865c74ea4cc41d7d34445 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Thu, 21 Dec 2017 15:22:18 -0800 Subject: [PATCH] Do not send recently added notification if item updated more than 24 hours ago --- plexpy/activity_handler.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plexpy/activity_handler.py b/plexpy/activity_handler.py index 6b38c866..296440df 100644 --- a/plexpy/activity_handler.py +++ b/plexpy/activity_handler.py @@ -484,6 +484,11 @@ def on_created(rating_key, **kwargs): if metadata: 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)) + notify = False data_factory = datafactory.DataFactory() if 'child_keys' not in kwargs: