From 8fd62e30b3afb88950274ee9a9cfaadc7b0572ec Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Thu, 9 Nov 2023 17:17:24 -0800 Subject: [PATCH 1/3] Fix duration_time typo --- plexpy/notification_handler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index a7336a30..8f1d6263 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -1156,7 +1156,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': CustomArrow(arrow.get(duration_sec), duration_format), + 'duration_time': CustomArrow(arrow.get(duration_sec), duration_format), 'poster_title': notify_params['poster_title'], 'poster_url': notify_params['poster_url'], 'plex_id': notify_params['plex_id'], From 5abdfd7377a6da718a67b4956b8268485e192de8 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:25:39 -0800 Subject: [PATCH 2/3] Make datestamp and timestamp formattable --- plexpy/notification_handler.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 8f1d6263..4ed08bf6 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -982,8 +982,8 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'current_weekday': now_iso[2], 'current_week': now_iso[1], 'week_number': now_iso[1], # Keep for backwards compatibility - 'datestamp': now.format(date_format), - 'timestamp': now.format(time_format), + 'datestamp': CustomArrow(now, date_format), + 'timestamp': CustomArrow(now, time_format), 'unixtime': helpers.timestamp(), 'utctime': helpers.utc_now_iso(), # Stream parameters @@ -1278,8 +1278,8 @@ def build_server_notify_params(notify_action=None, **kwargs): 'current_weekday': now_iso[2], 'current_week': now_iso[1], 'week_number': now_iso[1], # Keep for backwards compatibility - 'datestamp': now.format(date_format), - 'timestamp': now.format(time_format), + 'datestamp': CustomArrow(now, date_format), + 'timestamp': CustomArrow(now, time_format), 'unixtime': helpers.timestamp(), 'utctime': helpers.utc_now_iso(), # Plex remote access parameters From 98c363f559365e927b41bde3549bce6b37021df1 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Mon, 13 Nov 2023 11:28:53 -0800 Subject: [PATCH 3/3] Update Notification Text Modifiers modal with Time Formats --- data/interfaces/default/settings.html | 15 +++++++++++++++ plexpy/common.py | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 6710ff79..e5b0b321 100644 --- a/data/interfaces/default/settings.html +++ b/data/interfaces/default/settings.html @@ -1923,6 +1923,21 @@

Example:

{media_type}   --> movie
 {media_type!c} --> Movie
+ +
+

Time Formats

+
+
+

+ Notification parameters which are "in date format" or "in time format" can be formatted using the + Date & Time Format Options + by adding a :format specifier. + If no format is specified, the default Date Format and Time Format under Settings > General will be used. +

+

Example:

+
{started_datestamp:ddd, MMMM DD, YYYY}   --> Mon, December 25, 2023
+{stopped_timestamp:h:mm a}               --> 9:56 pm
+{duration_time:HH:mm:ss}                 --> 01:42:20

List Slicing

diff --git a/plexpy/common.py b/plexpy/common.py index c692840b..79b76b5c 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -636,7 +636,7 @@ NOTIFICATION_PARAMETERS = [ 'parameters': [ {'name': 'Update Version', 'type': 'str', 'value': 'update_version', 'description': 'The available update version for your Plex Server.'}, {'name': 'Update Url', 'type': 'str', 'value': 'update_url', 'description': 'The download URL for the available update.'}, - {'name': 'Update Release Date', 'type': 'str', 'value': 'update_release_date', 'description': 'The release date of the available update.'}, + {'name': 'Update Release Date', 'type': 'str', 'value': 'update_release_date', 'description': 'The release date (in date format) of the available update.'}, {'name': 'Update Channel', 'type': 'str', 'value': 'update_channel', 'description': 'The update channel.', 'example': 'Public or Plex Pass'}, {'name': 'Update Platform', 'type': 'str', 'value': 'update_platform', 'description': 'The platform of your Plex Server.'}, {'name': 'Update Distro', 'type': 'str', 'value': 'update_distro', 'description': 'The distro of your Plex Server.'},