diff --git a/plexpy/common.py b/plexpy/common.py index 591b33fa..19d10ecc 100644 --- a/plexpy/common.py +++ b/plexpy/common.py @@ -304,6 +304,7 @@ NOTIFICATION_PARAMETERS = [ {'name': 'Server Version', 'type': 'str', 'value': 'server_version', 'description': 'The current version of your Plex Server.'}, {'name': 'Server ID', 'type': 'str', 'value': 'server_machine_id', 'description': 'The unique identifier for your Plex Server.'}, {'name': 'Action', 'type': 'str', 'value': 'action', 'description': 'The action that triggered the notification.'}, + {'name': 'Week Number', 'type': 'int', 'value': 'week_number', 'description': 'The week number when the notfication was triggered.'}, {'name': 'Datestamp', 'type': 'str', 'value': 'datestamp', 'description': 'The date (in date format) when the notification was triggered.'}, {'name': 'Timestamp', 'type': 'str', 'value': 'timestamp', 'description': 'The time (in time format) when the notification was triggered.'}, {'name': 'Unix Time', 'type': 'int', 'value': 'unixtime', 'description': 'The unix timestamp when the notification was triggered.'}, @@ -520,6 +521,7 @@ NEWSLETTER_PARAMETERS = [ {'name': 'Server Name', 'type': 'str', 'value': 'server_name', 'description': 'The name of your Plex Server.'}, {'name': 'Start Date', 'type': 'str', 'value': 'start_date', 'description': 'The start date of the newesletter.'}, {'name': 'End Date', 'type': 'str', 'value': 'end_date', 'description': 'The end date of the newesletter.'}, + {'name': 'Week Number', 'type': 'int', 'value': 'week_number', 'description': 'The week number of the newsletter.'}, {'name': 'Newsletter Days', 'type': 'int', 'value': 'newsletter_days', 'description': 'The past number of days included in the newsletter.'}, {'name': 'Newsletter URL', 'type': 'str', 'value': 'newsletter_url', 'description': 'The self-hosted URL to the newsletter.'}, {'name': 'Newsletter UUID', 'type': 'str', 'value': 'newsletter_uuid', 'description': 'The unique identifier for the newsletter.'}, diff --git a/plexpy/newsletters.py b/plexpy/newsletters.py index 10a09f35..f4071311 100644 --- a/plexpy/newsletters.py +++ b/plexpy/newsletters.py @@ -477,6 +477,7 @@ class Newsletter(object): 'server_name': plexpy.CONFIG.PMS_NAME, 'start_date': self.start_date.format(date_format), 'end_date': self.end_date.format(date_format), + 'week_number': self.start_date.isocalendar()[1], 'newsletter_days': self.config['last_days'], 'newsletter_url': base_url.rstrip('/') + plexpy.HTTP_ROOT + 'newsletter/' + self.uuid, 'newsletter_uuid': self.uuid diff --git a/plexpy/notification_handler.py b/plexpy/notification_handler.py index 375cfad7..0fb7d7d0 100644 --- a/plexpy/notification_handler.py +++ b/plexpy/notification_handler.py @@ -710,6 +710,7 @@ def build_media_notify_params(notify_action=None, session=None, timeline=None, m 'server_platform': plexpy.CONFIG.PMS_PLATFORM, 'server_version': plexpy.CONFIG.PMS_VERSION, 'action': notify_action.lstrip('on_'), + 'week_number': arrow.now().isocalendar()[1], 'datestamp': arrow.now().format(date_format), 'timestamp': arrow.now().format(time_format), 'unixtime': int(time.time()),