Fix preview failing on cameras with - in name (#12093)

This commit is contained in:
Nicolas Mowen 2024-06-21 07:33:20 -06:00 committed by GitHub
parent b34be991bd
commit 3410290b45
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -219,12 +219,15 @@ class PreviewRecorder:
os.unlink(os.path.join(PREVIEW_CACHE_DIR, file)) os.unlink(os.path.join(PREVIEW_CACHE_DIR, file))
continue continue
file_time = file.split("-")[1][: -(len(PREVIEW_FRAME_TYPE) + 1)] try:
file_time = file.split("-")[-1][: -(len(PREVIEW_FRAME_TYPE) + 1)]
if not file_time: if not file_time:
continue continue
ts = float(file_time) ts = float(file_time)
except ValueError:
continue
if self.start_time == 0: if self.start_time == 0:
self.start_time = ts self.start_time = ts