diff --git a/__init__.py b/__init__.py index 6cc8fd20..fc4228cd 100644 --- a/__init__.py +++ b/__init__.py @@ -1210,10 +1210,10 @@ def createMVR_Commits(self, commits, station_uuid): clients = bpy.context.window_manager.dmx.mvr_xchange.mvr_xchange_clients for client in clients: if client.station_uuid == station_uuid: - client.commits.clear() + #client.commits.clear() for commit in commits: - + skip = False if "FileName" in commit: filename = commit["FileName"] else: @@ -1221,15 +1221,20 @@ def createMVR_Commits(self, commits, station_uuid): if not len(filename): filename = commit["FileUUID"] - now = int(datetime.now().timestamp()) - client.last_seen = now - new_commit = client.commits.add() - new_commit.station_uuid = station_uuid - new_commit.comment = commit["Comment"] - new_commit.commit_uuid = commit["FileUUID"] - new_commit.file_size = commit["FileSize"] - new_commit.file_name = filename - new_commit.timestamp = now + for existing_commit in client.commits: + if existing_commit.commit_uuid == commit["FileUUID"]: + skip = True + continue + if not skip: + now = int(datetime.now().timestamp()) + client.last_seen = now + new_commit = client.commits.add() + new_commit.station_uuid = station_uuid + new_commit.comment = commit["Comment"] + new_commit.commit_uuid = commit["FileUUID"] + new_commit.file_size = commit["FileSize"] + new_commit.file_name = filename + new_commit.timestamp = now def fetched_mvr_downloaded_file(self, commit): clients = bpy.context.window_manager.dmx.mvr_xchange.mvr_xchange_clients diff --git a/assets/mvrs/.gitkeep b/assets/mvrs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/mvrx_protocol.py b/mvrx_protocol.py index 4f30c95b..e6e709da 100644 --- a/mvrx_protocol.py +++ b/mvrx_protocol.py @@ -29,6 +29,8 @@ def callback(data): uuid = data["StationUUID"] if "Files" in data: DMX_MVR_X_Protocol._instance._dmx.createMVR_Commits(data["Files"], uuid) + if "FileUUID" in data: + DMX_MVR_X_Protocol._instance._dmx.createMVR_Commits([data], uuid) if "file_downloaded" in data: DMX_MVR_X_Protocol._instance._dmx.fetched_mvr_downloaded_file(data["file_downloaded"])