From ab5836a65b7846be835e148d89bd6de6ec781a4f Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Tue, 7 Nov 2023 17:12:19 -0800 Subject: [PATCH] Add duration_time notification parameter --- plexpy/common.py | 1 + plexpy/notification_handler.py | 1 + 2 files changed, 2 insertions(+) diff --git a/plexpy/common.py b/plexpy/common.py index 889d3f73..c692840b 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -547,6 +547,7 @@ NOTIFICATION_PARAMETERS = [ {'name': 'Duration', 'type': 'int', 'value': 'duration', 'description': 'The duration (in minutes) for the item.'}, {'name': 'Duration (sec)', 'type': 'int', 'value': 'duration_sec', 'description': 'The duration (in seconds) for the item.'}, {'name': 'Duration (ms)', 'type': 'int', 'value': 'duration_ms', 'description': 'The duration (in milliseconds) for the item.'}, + {'name': 'Duration Time', 'type': 'str', 'value': 'duration_time', 'description': 'The duration (in time format) for the item.'}, {'name': 'Poster URL', 'type': 'str', 'value': 'poster_url', 'description': 'A URL for the movie, TV show, or album poster.'}, {'name': 'Plex ID', 'type': 'str', 'value': 'plex_id', 'description': 'The Plex ID for the item.', 'example': 'e.g. 5d7769a9594b2b001e6a6b7e'}, {'name': 'Plex URL', 'type': 'str', 'value': 'plex_url', 'description': 'The Plex URL to your server for the item.'}, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 8b4b8583..b6972268 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -1155,6 +1155,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'duration': duration, 'duration_sec': duration_sec, 'duration_ms': notify_params['duration'], + 'druation_time': arrow.get(duration_sec).format(duration_format), 'poster_title': notify_params['poster_title'], 'poster_url': notify_params['poster_url'], 'plex_id': notify_params['plex_id'],