feat(log): 添加字幕记录复制功能 (#3)

- 提高记录时间精度,精确到毫秒
- 在字幕记录组件中添加复制到剪贴板的功能
- 提供多种复制选项,包括是否添加序号、是否复制时间、选择复制内容等
This commit is contained in:
himeditator
2025-07-08 01:33:48 +08:00
parent 082eb8579b
commit 8ac1c99c63
8 changed files with 84 additions and 15 deletions

View File

@@ -39,12 +39,12 @@ class Callback(TranslationRecognizerCallback):
caption['text'] = transcription_result.text
if caption['index'] != self.cur_id:
self.cur_id = caption['index']
cur_time = datetime.now().strftime('%H:%M:%S')
cur_time = datetime.now().strftime('%H:%M:%S.%f')[:-3]
caption['time_s'] = cur_time
self.time_str = cur_time
else:
caption['time_s'] = self.time_str
caption['time_t'] = datetime.now().strftime('%H:%M:%S')
caption['time_t'] = datetime.now().strftime('%H:%M:%S.%f')[:-3]
caption['translation'] = ""
if translation_result is not None: