Refactor code structure for improved readability and maintainability
This commit is contained in:
BIN
dist/renamer-0.7.4-py3-none-any.whl
vendored
Normal file
BIN
dist/renamer-0.7.4-py3-none-any.whl
vendored
Normal file
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "renamer"
|
||||
version = "0.7.3"
|
||||
version = "0.7.4"
|
||||
description = "Terminal-based media file renamer and metadata viewer"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
|
||||
@@ -137,7 +137,7 @@ class RenamerApp(App):
|
||||
"Select a file to view details", id="details_technical", markup=True
|
||||
)
|
||||
yield Static(
|
||||
"", id="details_catalog", markup=True
|
||||
"", id="details_catalog", markup=False
|
||||
)
|
||||
yield Static("", id="proposed", markup=True)
|
||||
yield Footer()
|
||||
|
||||
@@ -77,7 +77,6 @@ class CatalogFormatter:
|
||||
text_content = "\n\n".join(lines) if lines else "No catalog information available"
|
||||
|
||||
from rich.console import Console
|
||||
from rich.markup import escape
|
||||
from io import StringIO
|
||||
|
||||
console = Console(file=StringIO(), width=120, legacy_windows=False)
|
||||
@@ -85,13 +84,9 @@ class CatalogFormatter:
|
||||
rendered_text = console.file.getvalue()
|
||||
|
||||
# Append poster output if available
|
||||
# Escape ASCII art to prevent Rich from interpreting characters as markup
|
||||
# Don't process ASCII art through console - just append it directly
|
||||
if poster_output:
|
||||
# Escape special characters that Rich uses for markup
|
||||
escaped_poster = escape(poster_output)
|
||||
console2 = Console(file=StringIO(), width=120, legacy_windows=False)
|
||||
console2.print(escaped_poster, markup=False)
|
||||
return rendered_text + "\n" + console2.file.getvalue()
|
||||
return rendered_text + "\n" + poster_output
|
||||
else:
|
||||
return rendered_text
|
||||
|
||||
|
||||
Reference in New Issue
Block a user