Add error message for duplicate stream recordings (#75654)

This commit is contained in:
uvjustin 2022-07-23 23:40:45 +08:00 committed by GitHub
parent 5c234a3504
commit b71e3397fd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,4 +163,10 @@ class RecorderOutput(StreamOutput):
_LOGGER.error("Recording failed to capture anything") _LOGGER.error("Recording failed to capture anything")
else: else:
output.close() output.close()
try:
os.rename(self.video_path + ".tmp", self.video_path) os.rename(self.video_path + ".tmp", self.video_path)
except FileNotFoundError:
_LOGGER.error(
"Error writing to '%s'. There are likely multiple recordings writing to the same file",
self.video_path,
)