Add show_year notification parameter

This commit is contained in:
JonnyWong16 2022-07-14 18:45:00 -07:00
parent aeb572f211
commit 9f1b7de623
No known key found for this signature in database
GPG key ID: B1F1F9807184697A
2 changed files with 8 additions and 1 deletions

View file

@ -491,7 +491,7 @@ NOTIFICATION_PARAMETERS = [
{'name': 'Media Type', 'type': 'str', 'value': 'media_type', 'description': 'The type of media.', 'example': 'movie, show, season, episode, artist, album, track, clip'},
{'name': 'Title', 'type': 'str', 'value': 'title', 'description': 'The full title of the item.'},
{'name': 'Library Name', 'type': 'str', 'value': 'library_name', 'description': 'The library name of the item.'},
{'name': 'Show Name', 'type': 'str', 'value': 'show_name', 'description': 'The title of the TV series.'},
{'name': 'Show Name', 'type': 'str', 'value': 'show_name', 'description': 'The title of the TV show.'},
{'name': 'Season Name', 'type': 'str', 'value': 'season_name', 'description': 'The title of the TV season.'},
{'name': 'Episode Name', 'type': 'str', 'value': 'episode_name', 'description': 'The title of the TV episode.'},
{'name': 'Artist Name', 'type': 'str', 'value': 'artist_name', 'description': 'The name of the artist.'},
@ -511,6 +511,7 @@ NOTIFICATION_PARAMETERS = [
{'name': 'Album Count', 'type': 'int', 'value': 'album_count', 'description': 'The number of albums in a grouped recently added notification.'},
{'name': 'Track Count', 'type': 'int', 'value': 'track_count', 'description': 'The number of tracks in a grouped recently added notification.'},
{'name': 'Year', 'type': 'int', 'value': 'year', 'description': 'The release year for the item.'},
{'name': 'Show Year', 'type': 'int', 'value': 'show_year', 'description': 'The release year of the TV show.'},
{'name': 'Release Date', 'type': 'str', 'value': 'release_date', 'description': 'The release date (in date format) for the item.'},
{'name': 'Air Date', 'type': 'str', 'value': 'air_date', 'description': 'The air date (in date format) for the item.'},
{'name': 'Added Date', 'type': 'str', 'value': 'added_date', 'description': 'The date (in date format) the item was added to Plex.'},

View file

@ -862,6 +862,8 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
child_count = len(child_num)
grandchild_count = ''
show_year = notify_params['year']
elif ((manual_trigger or plexpy.CONFIG.NOTIFY_GROUP_RECENTLY_ADDED_PARENT)
and notify_params['media_type'] in ('season', 'album')):
show_name = notify_params['parent_title']
@ -885,6 +887,8 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
child_count = 1
grandchild_count = len(grandchild_num)
show_year = notify_params['parent_year']
else:
show_name = notify_params['grandparent_title']
season_name = notify_params['parent_title']
@ -902,6 +906,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
track_num00 = str(notify_params['media_index']).zfill(2)
child_count = 1
grandchild_count = 1
show_year = notify_params['grandparent_year']
rating = notify_params['rating'] or notify_params['audience_rating']
@ -1075,6 +1080,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m
'album_count': child_count,
'track_count': grandchild_count,
'year': notify_params['year'],
'show_year': show_year,
'release_date': arrow.get(notify_params['originally_available_at']).format(date_format)
if notify_params['originally_available_at'] else '',
'air_date': arrow.get(notify_params['originally_available_at']).format(date_format)