(self, tasks: List[FileTranscriptionTask])
| 59 | return tasks |
| 60 | |
| 61 | def save_json_tasks(self, tasks: List[FileTranscriptionTask]): |
| 62 | json_str = json.dumps([task.id for task in tasks]) |
| 63 | with open(self.tasks_list_file_path, "w") as file: |
| 64 | file.write(json_str) |
| 65 | |
| 66 | for task in tasks: |
| 67 | file_path = self.get_task_path(task_id=task.id) |
| 68 | json_str = task.to_json() |
| 69 | with open(file_path, "w") as file: |
| 70 | file.write(json_str) |
| 71 | |
| 72 | def get_task_path(self, task_id: int): |
| 73 | path = os.path.join(self.cache_dir, "transcriptions", f"{task_id}.json") |
no test coverage detected