feat: Add OpenScreen for directory input and validation

feat: Introduce poster rendering views with multiple engines

feat: Implement ASCII art poster renderer using PIL

feat: Create base class for poster renderers

feat: Add RichPixels renderer for high-quality terminal image display

feat: Implement Viu terminal image viewer renderer

feat: Add ProposedFilenameView for generating standardized filenames

feat: Create RenameConfirmScreen for renaming files with confirmation

feat: Implement SettingsScreen for configuring application settings

feat: Add custom PosterWidget for rendering poster images
This commit is contained in:
sha
2026-04-11 22:09:29 +03:00
parent 8274cb4e9f
commit 2e652ae58a
110 changed files with 193 additions and 214 deletions
+45
View File
@@ -0,0 +1,45 @@
class TrackFormatter:
"""Class to format track information into display strings"""
@staticmethod
def format_video_track(track: dict) -> str:
"""Format a video track dict into a display string"""
codec = track.get('codec', 'unknown')
width = track.get('width', '?')
height = track.get('height', '?')
bitrate = track.get('bitrate') # in bps
bitrate_kbps = int(round(bitrate / 1024)) if bitrate else None
fps = track.get('fps')
profile = track.get('profile')
video_str = f"{codec} {width}x{height}"
if bitrate_kbps:
video_str += f" {bitrate_kbps}kbps"
if fps:
video_str += f" {fps}fps"
if profile:
video_str += f" ({profile})"
return video_str
@staticmethod
def format_audio_track(track: dict) -> str:
"""Format an audio track dict into a display string"""
codec = track.get('codec', 'unknown')
channels = track.get('channels', '?')
lang = track.get('language', 'und')
bitrate = track.get('bitrate') # in bps
bitrate_kbps = int(round(bitrate / 1024)) if bitrate else None
audio_str = f"{codec} {channels}ch {lang}"
if bitrate_kbps:
audio_str += f" {bitrate_kbps}kbps"
return audio_str
@staticmethod
def format_subtitle_track(track: dict) -> str:
"""Format a subtitle track dict into a display string"""
lang = track.get('language', 'und')
format = track.get('format', 'unknown')
return f"{lang} ({format})"