fix: unify task workspace directory resolution
This commit is contained in:
@ -5,6 +5,7 @@ from pathlib import Path
|
||||
import re
|
||||
|
||||
from biliup_next.core.models import ActionRecord, SessionBinding, TaskContext, utc_now_iso
|
||||
from biliup_next.infra.workspace_paths import resolve_task_work_dir
|
||||
|
||||
|
||||
class SessionDeliveryService:
|
||||
@ -222,10 +223,10 @@ class SessionDeliveryService:
|
||||
return None
|
||||
return bvid
|
||||
|
||||
def _full_video_bvid_path(self, task_title: str) -> Path:
|
||||
session_dir = Path(str(self.settings["paths"]["session_dir"])) / task_title
|
||||
session_dir.mkdir(parents=True, exist_ok=True)
|
||||
return session_dir / "full_video_bvid.txt"
|
||||
def _full_video_bvid_path(self, task) -> Path: # type: ignore[no-untyped-def]
|
||||
work_dir = resolve_task_work_dir(task)
|
||||
work_dir.mkdir(parents=True, exist_ok=True)
|
||||
return work_dir / "full_video_bvid.txt"
|
||||
|
||||
def _upsert_session_binding_for_context(self, context: TaskContext, full_video_bvid: str, now: str) -> None:
|
||||
self.repo.upsert_session_binding(
|
||||
@ -253,6 +254,6 @@ class SessionDeliveryService:
|
||||
context.updated_at = now
|
||||
self.repo.upsert_task_context(context)
|
||||
self._upsert_session_binding_for_context(context, full_video_bvid, now)
|
||||
path = self._full_video_bvid_path(task.title)
|
||||
path = self._full_video_bvid_path(task)
|
||||
path.write_text(full_video_bvid, encoding="utf-8")
|
||||
return path
|
||||
|
||||
Reference in New Issue
Block a user