Fxing the cache path
This commit is contained in:
+4
-15
@@ -197,7 +197,6 @@ def _resolve_video_path(
|
||||
video_source: VideoSource,
|
||||
shared_assets_dir: Path = None,
|
||||
project_path: Path = None,
|
||||
process_cache_dir: Path = None,
|
||||
) -> Path:
|
||||
"""Resolve the actual video file path (output_file if exists, else source_file).
|
||||
|
||||
@@ -206,7 +205,6 @@ def _resolve_video_path(
|
||||
|
||||
If video_source.is_shared is True, looks in shared_assets_dir instead of videos_dir.
|
||||
Uses gnommocache fallback if configured and project_path is provided.
|
||||
When process_cache_dir is set, also checks {cache}/videos/ for the file.
|
||||
"""
|
||||
from .cache import resolve_with_cache
|
||||
|
||||
@@ -235,12 +233,6 @@ def _resolve_video_path(
|
||||
elif webm_path.exists():
|
||||
return webm_path
|
||||
|
||||
# Check process_cache_dir before falling back to source_file in project
|
||||
if process_cache_dir and not video_source.is_shared:
|
||||
cache_path = process_cache_dir / "videos" / video_source.source_file
|
||||
if cache_path.exists():
|
||||
return cache_path
|
||||
|
||||
# Fall back to source_file with cache fallback
|
||||
source_path = base_dir / video_source.source_file
|
||||
if project_path:
|
||||
@@ -318,9 +310,6 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
|
||||
shared_assets_dir = (
|
||||
plan.shared_assets_dir.resolve() if plan.shared_assets_dir else None
|
||||
)
|
||||
process_cache_dir = (
|
||||
plan.process_cache_dir.resolve() if plan.process_cache_dir else None
|
||||
)
|
||||
|
||||
# Track input indices
|
||||
input_idx = 0
|
||||
@@ -330,7 +319,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
|
||||
always_visible_inputs: list[int] = []
|
||||
for video_id, video_source, cutout in plan.narration_videos:
|
||||
video_path = _resolve_video_path(
|
||||
videos_dir, video_source, shared_assets_dir, project_path, process_cache_dir
|
||||
videos_dir, video_source, shared_assets_dir, project_path
|
||||
)
|
||||
# Combine video skip setting with partial render offset
|
||||
total_seek = video_source.skip + plan.input_seek_time
|
||||
@@ -404,7 +393,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
|
||||
|
||||
for i, event in enumerate(plan.video_events):
|
||||
video_path = _resolve_video_path(
|
||||
videos_dir, event.video_source, shared_assets_dir, project_path, process_cache_dir
|
||||
videos_dir, event.video_source, shared_assets_dir, project_path
|
||||
)
|
||||
skip = event.video_source.skip or 0.0
|
||||
if skip > 0:
|
||||
@@ -434,7 +423,7 @@ def build_ffmpeg_command(plan: RenderPlan, output_path: Path) -> list[str]:
|
||||
|
||||
for i, event in enumerate(plan.outro_events):
|
||||
video_path = _resolve_video_path(
|
||||
videos_dir, event.video_source, shared_assets_dir, project_path, process_cache_dir
|
||||
videos_dir, event.video_source, shared_assets_dir, project_path
|
||||
)
|
||||
skip = event.video_source.skip or 0.0
|
||||
if skip > 0:
|
||||
@@ -1114,7 +1103,7 @@ def build_filter_complex(
|
||||
use_channels = first_video_source.use_audio_channels
|
||||
if use_channels == "auto":
|
||||
narration_path = _resolve_video_path(
|
||||
videos_dir, first_video_source, shared_assets_dir, project_path, process_cache_dir
|
||||
videos_dir, first_video_source, shared_assets_dir, project_path
|
||||
)
|
||||
use_channels = _resolve_auto_channel(narration_path)
|
||||
channel_filter = _build_audio_channel_filter(use_channels)
|
||||
|
||||
Reference in New Issue
Block a user