diff --git a/data/interfaces/default/css/plexpy.css b/data/interfaces/default/css/plexpy.css index c271be54..a9a6f36e 100644 --- a/data/interfaces/default/css/plexpy.css +++ b/data/interfaces/default/css/plexpy.css @@ -2718,4 +2718,8 @@ table[id^='media_info_child'] table[id^='media_info_child'] thead th { } .selectize-input input[type='text'] { height: 20px; +} +.small-muted { + font-size: small; + color: #777; } \ No newline at end of file diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 7dabae20..1a8651a8 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1128,7 +1128,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {ip_address} - The IP address of the device being used for playback. (PMS 0.9.14 and above) + The IP address of the device being used for playback. (PMS 0.9.14 and above) {stream_duration} @@ -1291,7 +1291,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {season_num} - The season number for the item if item is episode. + The season number for the episode. {season_num00} @@ -1299,7 +1299,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {episode_num} - The episode number for the item if item is episode. + The episode number for the episode. {episode_num00} @@ -1307,7 +1307,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {track_num} - The track number for the item if item is track. + The track number for the track. {track_num00} @@ -1323,7 +1323,7 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {content_rating} - The content rating for the item. (e.g. TV-MA, TV-PG, etc.) + The content rating for the item. (e.g. TV-MA, TV-PG, etc.) {directors} @@ -1357,21 +1357,60 @@ available_notification_agents = sorted(notifiers.available_notification_agents() {duration} The duration (in minutes) for the item. + + {imdb_id} + The IMDB ID for the movie. (e.g. tt2488496) +

(PMS agent must be Freebase)

+ + + {imdb_url} + The IMDB URL for the movie. +

(PMS agent must be Freebase)

+ + + {thetvdb_id} + The TVDB ID for the TV show. (e.g. 121361) +

(PMS agent must be TheTVDB)

+ + + {thetvdb_url} + The TVDB URL for the TV show. +

(PMS agent must be TheTVDB)

+ + + {themoviedb_id} + The TMDb ID for the movie or TV show. (e.g. 15260) +

(PMS agent must be The Movie Database)

+ + + {themoviedb_url} + The TMDb URL for the movie or TV show. +

(PMS agent must be The Movie Database)

+ + + {lastfm_url} + The last.fm URL for the album. +

(PMS agent must be Last.fm)

+ + + {trakt_url} + The trakt.tv URL for the movie or TV show. + {section_id} The unique identifier for the library. {rating_key} - The unique identifier for the item. + The unique identifier for the movie, episode, or track. {parent_rating_key} - The unique identifier for the item's parent (season or album). + The unique identifier for the season or album. {grandparent_rating_key} - The unique identifier for the item's grandparent (TV show or artist). + The unique identifier for the TV show or artist. diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index a4234a9f..a5cb0480 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -457,6 +457,37 @@ def build_notify_text(session=None, timeline=None, state=None): progress_percent = helpers.get_percent(view_offset, duration) remaining_duration = duration - view_offset + # Get media IDs from guid and build URLs + if 'imdb://' in metadata['guid']: + metadata['imdb_id'] = metadata['guid'].split('imdb://')[1].split('?')[0] + metadata['imdb_url'] = 'https://www.imdb.com/title/' + metadata['imdb_id'] + metadata['trakt_url'] = 'https://trakt.tv/search/imdb/' + metadata['imdb_id'] + + if 'thetvdb://' in metadata['guid']: + metadata['thetvdb_id'] = metadata['guid'].split('thetvdb://')[1].split('/')[0] + metadata['thetvdb_url'] = 'https://thetvdb.com/?tab=series&id=' + metadata['thetvdb_id'] + metadata['trakt_url'] = 'https://trakt.tv/search/tvdb/' + metadata['thetvdb_id'] + '?id_type=show' + + elif 'thetvdbdvdorder://' in metadata['guid']: + metadata['thetvdb_id'] = metadata['guid'].split('thetvdbdvdorder://')[1].split('/')[0] + metadata['thetvdb_url'] = 'https://thetvdb.com/?tab=series&id=' + metadata['thetvdb_id'] + metadata['trakt_url'] = 'https://trakt.tv/search/tvdb/' + metadata['thetvdb_id'] + '?id_type=show' + + if 'themoviedb://' in metadata['guid']: + if metadata['media_type'] == 'movie': + metadata['themoviedb_id'] = metadata['guid'].split('themoviedb://')[1].split('?')[0] + metadata['themoviedb_url'] = 'https://www.themoviedb.org/movie/' + metadata['themoviedb_id'] + metadata['trakt_url'] = 'https://trakt.tv/search/tmdb/' + metadata['themoviedb_id'] + '?id_type=movie' + + elif metadata['media_type'] == 'show' or metadata['media_type'] == 'episode': + metadata['themoviedb_id'] = metadata['guid'].split('themoviedb://')[1].split('/')[0] + metadata['themoviedb_url'] = 'https://www.themoviedb.org/tv/' + metadata['themoviedb_id'] + metadata['trakt_url'] = 'https://trakt.tv/search/tmdb/' + metadata['themoviedb_id'] + '?id_type=show' + + if 'lastfm://' in metadata['guid']: + metadata['lastfm_id'] = metadata['guid'].split('lastfm://')[1].rsplit('/', 1)[0] + metadata['lastfm_url'] = 'https://www.last.fm/music/' + metadata['lastfm_id'] + # Fix metadata params for notify recently added grandparent if state == 'created' and plexpy.CONFIG.NOTIFY_RECENTLY_ADDED_GRANDPARENT: show_name = metadata['title'] @@ -538,6 +569,14 @@ def build_notify_text(session=None, timeline=None, state=None): 'tagline': metadata['tagline'], 'rating': metadata['rating'], 'duration': duration, + 'imdb_id': metadata.get('imdb_id',''), + 'imdb_url': metadata.get('imdb_url',''), + 'thetvdb_id': metadata.get('thetvdb_id',''), + 'thetvdb_url': metadata.get('thetvdb_url',''), + 'themoviedb_id': metadata.get('themoviedb_id',''), + 'themoviedb_url': metadata.get('themoviedb_url',''), + 'lastfm_url': metadata.get('lastfm_url',''), + 'trakt_url': metadata.get('trakt_url',''), 'section_id': metadata['section_id'], 'rating_key': metadata['rating_key'], 'parent_rating_key': metadata['parent_rating_key'],