handle nested dirs
This commit is contained in:
@@ -85,6 +85,17 @@ def _print_ffmpeg(msg):
|
||||
print(f"{_ANSI_GREEN}{msg}{_ANSI_RST}")
|
||||
|
||||
|
||||
def _ffmpeg_first_for_gameplay_path(path):
|
||||
"""Under ...\\gameplay\\, Shell GetThumbnail often fails and Icaros cache misses; go straight to FFmpeg."""
|
||||
if not _ffmpeg_enabled():
|
||||
return False
|
||||
try:
|
||||
p = os.path.normpath(path).replace("/", "\\").lower()
|
||||
except Exception:
|
||||
return False
|
||||
return "\\gameplay\\" in p
|
||||
|
||||
|
||||
def find_files(dir):
|
||||
# Only process formats that Synology doesn't handle well
|
||||
# Exclude common images (jpg, png, gif, etc.) since NAS handles them fine
|
||||
@@ -145,6 +156,10 @@ def ensure_directory_exists(path):
|
||||
|
||||
def create_video_thumbnails(source_path, dest_dir):
|
||||
"""Generate video thumbnails: Windows Shell (Icaros-backed) first, FFmpeg fallback."""
|
||||
if _ffmpeg_first_for_gameplay_path(source_path):
|
||||
_print_ffmpeg(f"Using FFmpeg directly (gameplay subtree): {source_path}")
|
||||
create_video_thumbnails_ffmpeg(source_path, dest_dir)
|
||||
return
|
||||
# Try Windows thumbnail extraction first (leverages Icaros provider when present)
|
||||
windows_thumb = extract_windows_thumbnail(source_path)
|
||||
if windows_thumb:
|
||||
|
||||
Reference in New Issue
Block a user