From fd8ee9fe549c8d0c514edc508b6178b345d930d0 Mon Sep 17 00:00:00 2001 From: David Trattnig <david.trattnig@o94.at> Date: Thu, 1 Oct 2020 16:01:42 +0200 Subject: [PATCH] Added "is_synced" in playlog. #10 #13 --- src/rest/models/play_log.py | 34 +++++++++++++++++++++++++++++++--- src/rest/swagger/swagger.yaml | 25 +++++++++++++++++-------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/src/rest/models/play_log.py b/src/rest/models/play_log.py index e958093..f9eec30 100644 --- a/src/rest/models/play_log.py +++ b/src/rest/models/play_log.py @@ -14,7 +14,7 @@ class PlayLog(Model): Do not edit the class manually. """ - def __init__(self, track_start=None, track_artist=None, track_album=None, track_title=None, track_duration=None, track_type=None, track_num=None, playlist_id=None, schedule_id=None, show_id=None, show_name=None, log_source=None): # noqa: E501 + def __init__(self, track_start=None, track_artist=None, track_album=None, track_title=None, track_duration=None, track_type=None, track_num=None, playlist_id=None, schedule_id=None, show_id=None, show_name=None, log_source=None, is_synced=None): # noqa: E501 """PlayLog - a model defined in Swagger :param track_start: The track_start of this PlayLog. # noqa: E501 @@ -41,6 +41,8 @@ class PlayLog(Model): :type show_name: str :param log_source: The log_source of this PlayLog. # noqa: E501 :type log_source: int + :param is_synced: The is_synced of this PlayLog. # noqa: E501 + :type is_synced: bool """ self.swagger_types = { 'track_start': datetime, @@ -54,7 +56,8 @@ class PlayLog(Model): 'schedule_id': int, 'show_id': int, 'show_name': str, - 'log_source': int + 'log_source': int, + 'is_synced': bool } self.attribute_map = { @@ -69,7 +72,8 @@ class PlayLog(Model): 'schedule_id': 'schedule_id', 'show_id': 'show_id', 'show_name': 'show_name', - 'log_source': 'log_source' + 'log_source': 'log_source', + 'is_synced': 'is_synced' } self._track_start = track_start self._track_artist = track_artist @@ -83,6 +87,7 @@ class PlayLog(Model): self._show_id = show_id self._show_name = show_name self._log_source = log_source + self._is_synced = is_synced @classmethod def from_dict(cls, dikt): @@ -352,3 +357,26 @@ class PlayLog(Model): """ self._log_source = log_source + + @property + def is_synced(self): + """Gets the is_synced of this PlayLog. + + For Engine API internal use only - On a main node such as Engine 1 or 2 this flag indicates if the playlog has been actively synced to the sync node. On the sync node in contrast this flag indicates if the playlog has been passively synced from one of the main nodes. # noqa: E501 + + :return: The is_synced of this PlayLog. + :rtype: bool + """ + return self._is_synced + + @is_synced.setter + def is_synced(self, is_synced): + """Sets the is_synced of this PlayLog. + + For Engine API internal use only - On a main node such as Engine 1 or 2 this flag indicates if the playlog has been actively synced to the sync node. On the sync node in contrast this flag indicates if the playlog has been passively synced from one of the main nodes. # noqa: E501 + + :param is_synced: The is_synced of this PlayLog. + :type is_synced: bool + """ + + self._is_synced = is_synced diff --git a/src/rest/swagger/swagger.yaml b/src/rest/swagger/swagger.yaml index d32a826..0c6553b 100644 --- a/src/rest/swagger/swagger.yaml +++ b/src/rest/swagger/swagger.yaml @@ -481,18 +481,26 @@ components: description: From which engine the entry has been logged from e.g. "1" for Engine 1 or "2" for Engine 2 example: 1 + is_synced: + type: boolean + description: For Engine API internal use only - On a main node such as Engine + 1 or 2 this flag indicates if the playlog has been actively synced to + the sync node. On the sync node in contrast this flag indicates if the + playlog has been passively synced from one of the main nodes. + example: true example: track_album: Bricolage show_id: 42 + track_title: Chomp Samba + show_name: Electronic Music from Brazil + track_artist: Amon Tobin + track_type: 2 + is_synced: true playlist_id: 38 track_start: 2020-08-29T09:12:33.001Z - track_title: Chomp Samba track_num: 11 - show_name: Electronic Music from Brazil log_source: 1 - track_artist: Amon Tobin track_duration: 808 - track_type: 2 schedule_id: 23 HealthLog: required: @@ -551,15 +559,16 @@ components: current_track: track_album: Bricolage show_id: 42 + track_title: Chomp Samba + show_name: Electronic Music from Brazil + track_artist: Amon Tobin + track_type: 2 + is_synced: true playlist_id: 38 track_start: 2020-08-29T09:12:33.001Z - track_title: Chomp Samba track_num: 11 - show_name: Electronic Music from Brazil log_source: 1 - track_artist: Amon Tobin track_duration: 808 - track_type: 2 schedule_id: 23 current_schedule: show_id: 42 -- GitLab