mirror of
https://github.com/MrSleeps/jellyfin-scene-search.git
synced 2026-11-17 23:41:28 +00:00
22 lines
509 B
Python
22 lines
509 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from .config import settings
|
|
|
|
|
|
def resolve_thumb_path(stored_path: str | Path) -> Path:
|
|
"""Resolve a stored thumbnail path across host/container DATA_DIR changes."""
|
|
path = Path(stored_path)
|
|
if path.is_file():
|
|
return path
|
|
|
|
parts = path.parts
|
|
try:
|
|
thumbs_index = parts.index("thumbs")
|
|
except ValueError:
|
|
return path
|
|
|
|
rebased = settings.data_dir.joinpath(*parts[thumbs_index:])
|
|
return rebased
|