Restore title argument to recently added queue jobs

* Fixes #1429
This commit is contained in:
JonnyWong16 2021-05-06 18:43:08 -07:00
parent 29637fe5cc
commit 897f415695
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 15 additions and 10 deletions

View file

@ -454,7 +454,7 @@ class TimelineHandler(object):
# Schedule a callback to clear the recently added queue # Schedule a callback to clear the recently added queue
schedule_callback('rating_key-{}'.format(grandparent_rating_key), schedule_callback('rating_key-{}'.format(grandparent_rating_key),
func=clear_recently_added_queue, func=clear_recently_added_queue,
args=[grandparent_rating_key], args=[grandparent_rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY) seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
elif media_type in ('season', 'album'): elif media_type in ('season', 'album'):
@ -469,7 +469,7 @@ class TimelineHandler(object):
# Schedule a callback to clear the recently added queue # Schedule a callback to clear the recently added queue
schedule_callback('rating_key-{}'.format(parent_rating_key), schedule_callback('rating_key-{}'.format(parent_rating_key),
func=clear_recently_added_queue, func=clear_recently_added_queue,
args=[parent_rating_key], args=[parent_rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY) seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
elif media_type in ('movie', 'show', 'artist'): elif media_type in ('movie', 'show', 'artist'):
@ -483,7 +483,7 @@ class TimelineHandler(object):
# Schedule a callback to clear the recently added queue # Schedule a callback to clear the recently added queue
schedule_callback('rating_key-{}'.format(rating_key), schedule_callback('rating_key-{}'.format(rating_key),
func=clear_recently_added_queue, func=clear_recently_added_queue,
args=[rating_key], args=[rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY) seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
# A movie, show, or artist is done processing # A movie, show, or artist is done processing
@ -633,7 +633,10 @@ def force_stop_stream(session_key, title, user):
delete_metadata_cache(session_key) delete_metadata_cache(session_key)
def clear_recently_added_queue(rating_key): def clear_recently_added_queue(rating_key, title):
logger.debug("Tautulli TimelineHandler :: Starting callback for library item '%s' (%s) after delay.",
title, str(rating_key))
child_keys = RECENTLY_ADDED_QUEUE[rating_key] child_keys = RECENTLY_ADDED_QUEUE[rating_key]
if plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT and len(child_keys) > 1: if plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_GRANDPARENT and len(child_keys) > 1:
@ -661,10 +664,12 @@ def clear_recently_added_queue(rating_key):
def on_created(rating_key, **kwargs): def on_created(rating_key, **kwargs):
logger.debug("Tautulli TimelineHandler :: Library item %s added to Plex." % str(rating_key))
pms_connect = pmsconnect.PmsConnect() pms_connect = pmsconnect.PmsConnect()
metadata = pms_connect.get_metadata_details(rating_key) metadata = pms_connect.get_metadata_details(rating_key)
logger.debug("Tautulli TimelineHandler :: Library item '%s' (%s) added to Plex.",
metadata['full_title'], str(rating_key))
if metadata: if metadata:
notify = True notify = True
# now = helpers.timestamp() # now = helpers.timestamp()