diff --git a/data/interfaces/default/settings.html b/data/interfaces/default/settings.html index 44883702..e266a0ba 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.'}, diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 0d976811..9fd07dd3 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 @@ -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'], @@ -1237,7 +1237,7 @@ def build_server_notify_params(notify_action=None, **kwargs): date_format = plexpy.CONFIG.DATE_FORMAT.replace('Do','') time_format = plexpy.CONFIG.TIME_FORMAT.replace('Do','') - for pmsconnect in server_manager.ServerManger().get_server_list(): +for pmsconnect in server_manager.ServerManger().get_server_list(): update_channel = pmsconnect.get_server_update_channel() pms_download_info = defaultdict(str, kwargs.pop('pms_download_info', {})) @@ -1279,8 +1279,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