diff --git a/dist/renamer-0.7.2-py3-none-any.whl b/dist/renamer-0.7.2-py3-none-any.whl new file mode 100644 index 0000000..50b7d9f Binary files /dev/null and b/dist/renamer-0.7.2-py3-none-any.whl differ diff --git a/pyproject.toml b/pyproject.toml index 76ec802..4df51d9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "renamer" -version = "0.7.1" +version = "0.7.2" description = "Terminal-based media file renamer and metadata viewer" readme = "README.md" requires-python = ">=3.11" diff --git a/renamer/formatters/catalog_formatter.py b/renamer/formatters/catalog_formatter.py index 9e168cb..80f964c 100644 --- a/renamer/formatters/catalog_formatter.py +++ b/renamer/formatters/catalog_formatter.py @@ -11,6 +11,7 @@ class CatalogFormatter: def format_catalog_info(self) -> str: """Format catalog information for display""" lines = [] + poster_output = None # Title title = self.extractor.get("title", "TMDB") @@ -54,24 +55,30 @@ class CatalogFormatter: if countries: lines.append(f"{TextFormatter.bold('Countries:')} {countries}") - # Poster + # Poster - handle separately to avoid Rich markup processing poster_image_path = self.extractor.tmdb_extractor.extract_poster_image_path() if poster_image_path: lines.append(f"{TextFormatter.bold('Poster:')}") - lines.append(self._display_poster(poster_image_path)) + poster_output = self._display_poster(poster_image_path) else: poster_path = self.extractor.get("poster_path", "TMDB") if poster_path: lines.append(f"{TextFormatter.bold('Poster:')} {poster_path} (not cached yet)") - full_text = "\n\n".join(lines) if lines else "No catalog information available" - - # Render markup to ANSI + # Render text content with Rich markup + text_content = "\n\n".join(lines) if lines else "No catalog information available" + from rich.console import Console from io import StringIO console = Console(file=StringIO(), width=120, legacy_windows=False) - console.print(full_text, markup=True) - return console.file.getvalue() + console.print(text_content, markup=True) + rendered_text = console.file.getvalue() + + # Append poster output directly (already contains ANSI codes from viu) + if poster_output: + return rendered_text + "\n" + poster_output + else: + return rendered_text def _display_poster(self, image_path: str) -> str: """Display poster image in terminal using viu""" diff --git a/uv.lock b/uv.lock index 016a741..a6f28ae 100644 --- a/uv.lock +++ b/uv.lock @@ -462,7 +462,7 @@ wheels = [ [[package]] name = "renamer" -version = "0.7.1" +version = "0.7.2" source = { editable = "." } dependencies = [ { name = "langcodes" },