mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 03:27:34 +00:00
- Added `langcodes` dependency for improved language handling. - Replaced `ColorFormatter` with `TextFormatter` for consistent text styling across the application. - Introduced `TrackFormatter` for better track information formatting. - Updated `MediaFormatter` to utilize new formatting methods and improved data handling. - Refactored `MediaExtractor` to enhance data extraction logic and improve readability. - Removed deprecated `ColorFormatter` methods and replaced them with `TextFormatter` equivalents. - Added new methods for extracting and formatting audio and subtitle tracks. - Updated tests to reflect changes in the extraction logic and formatting.
16 lines
555 B
Python
16 lines
555 B
Python
from pathlib import Path
|
|
from ..constants import MEDIA_TYPES
|
|
from .text_formatter import TextFormatter
|
|
|
|
|
|
class ExtensionFormatter:
|
|
"""Class for formatting extension information"""
|
|
|
|
@staticmethod
|
|
def format_extension_info(ext_name: str) -> str:
|
|
"""Format extension information"""
|
|
if ext_name in MEDIA_TYPES:
|
|
ext_desc = MEDIA_TYPES[ext_name]['description']
|
|
return f"{ext_name} - {TextFormatter.grey(ext_desc)}"
|
|
else:
|
|
return f"{ext_name} - {TextFormatter.grey('Unknown extension')}" |