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_callback('rating_key-{}'.format(grandparent_rating_key),
func=clear_recently_added_queue,
args=[grandparent_rating_key],
args=[grandparent_rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
elif media_type in ('season', 'album'):
@ -469,7 +469,7 @@ class TimelineHandler(object):
# Schedule a callback to clear the recently added queue
schedule_callback('rating_key-{}'.format(parent_rating_key),
func=clear_recently_added_queue,
args=[parent_rating_key],
args=[parent_rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
elif media_type in ('movie', 'show', 'artist'):
@ -483,7 +483,7 @@ class TimelineHandler(object):
# Schedule a callback to clear the recently added queue
schedule_callback('rating_key-{}'.format(rating_key),
func=clear_recently_added_queue,
args=[rating_key],
args=[rating_key, title],
seconds=plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_DELAY)
# 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)
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]
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):
logger.debug("Tautulli TimelineHandler :: Library item %s added to Plex." % str(rating_key))
pms_connect = pmsconnect.PmsConnect()
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:
notify = True
# now = helpers.timestamp()

View file

@ -891,7 +891,7 @@ class PmsConnect(object):
'collections': show_details.get('collections', []),
'guids': show_details.get('guids', []),
'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'),
helpers.get_xml_attr(metadata_main, 'title')),
helpers.get_xml_attr(metadata_main, 'title')),
'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')),
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
}
@ -964,7 +964,7 @@ class PmsConnect(object):
'collections': show_details.get('collections', []),
'guids': show_details.get('guids', []),
'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'grandparentTitle'),
helpers.get_xml_attr(metadata_main, 'title')),
helpers.get_xml_attr(metadata_main, 'title')),
'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')),
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
}
@ -1065,7 +1065,7 @@ class PmsConnect(object):
'collections': collections,
'guids': guids,
'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle'),
helpers.get_xml_attr(metadata_main, 'title')),
helpers.get_xml_attr(metadata_main, 'title')),
'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')),
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
}
@ -1119,7 +1119,7 @@ class PmsConnect(object):
'collections': album_details.get('collections', []),
'guids': album_details.get('guids', []),
'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'title'),
track_artist),
track_artist),
'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')),
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
}
@ -1220,7 +1220,7 @@ class PmsConnect(object):
'collections': photo_album_details.get('collections', []),
'guids': photo_album_details.get('guids', []),
'full_title': '{} - {}'.format(helpers.get_xml_attr(metadata_main, 'parentTitle') or library_name,
helpers.get_xml_attr(metadata_main, 'title')),
helpers.get_xml_attr(metadata_main, 'title')),
'children_count': helpers.cast_to_int(helpers.get_xml_attr(metadata_main, 'leafCount')),
'live': int(helpers.get_xml_attr(metadata_main, 'live') == '1')
}