feature: more omprovments phase 3
Build & Push DEV to DockerHub / docker (pull_request) Failing after 33s
Build & Push DEV to DockerHub / docker (pull_request) Failing after 33s
This commit is contained in:
@@ -3,7 +3,6 @@ Movie Processor for NFOGuard
|
||||
Handles movie processing and metadata management
|
||||
"""
|
||||
import os
|
||||
import glob
|
||||
import re
|
||||
import xml.etree.ElementTree as ET
|
||||
from pathlib import Path
|
||||
@@ -18,6 +17,7 @@ from clients.radarr_client import RadarrClient
|
||||
from clients.external_clients import ExternalClientManager
|
||||
from config.settings import config
|
||||
from utils.logging import _log
|
||||
from utils.file_utils import find_media_path_by_imdb_and_title
|
||||
|
||||
|
||||
def _get_local_timezone():
|
||||
@@ -79,36 +79,14 @@ class MovieProcessor:
|
||||
self.external_clients = ExternalClientManager()
|
||||
|
||||
def find_movie_path(self, movie_title: str, imdb_id: str, radarr_path: str = None) -> Optional[Path]:
|
||||
"""Find movie directory path"""
|
||||
# Try webhook path first
|
||||
if radarr_path:
|
||||
container_path = self.path_mapper.radarr_path_to_container_path(radarr_path)
|
||||
path_obj = Path(container_path)
|
||||
if path_obj.exists():
|
||||
return path_obj
|
||||
|
||||
# Search by IMDb ID or title
|
||||
for media_path in config.movie_paths:
|
||||
if not media_path.exists():
|
||||
continue
|
||||
|
||||
# Search by IMDb ID
|
||||
if imdb_id:
|
||||
pattern = str(media_path / f"*[imdb-{imdb_id}]*")
|
||||
matches = glob.glob(pattern)
|
||||
if matches:
|
||||
return Path(matches[0])
|
||||
|
||||
# Search by title
|
||||
if movie_title:
|
||||
title_clean = movie_title.lower().replace(" ", "").replace("-", "")
|
||||
for item in media_path.iterdir():
|
||||
if item.is_dir() and "[imdb-" in item.name.lower():
|
||||
item_clean = item.name.lower().replace(" ", "").replace("-", "")
|
||||
if title_clean in item_clean:
|
||||
return item
|
||||
|
||||
return None
|
||||
"""Find movie directory path using unified file utilities"""
|
||||
return find_media_path_by_imdb_and_title(
|
||||
title=movie_title,
|
||||
imdb_id=imdb_id,
|
||||
search_paths=config.movie_paths,
|
||||
webhook_path=radarr_path,
|
||||
path_mapper=self.path_mapper
|
||||
)
|
||||
|
||||
def process_movie(self, movie_path: Path, webhook_mode: bool = False) -> None:
|
||||
"""Process a movie directory"""
|
||||
|
||||
Reference in New Issue
Block a user