mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 11:33:25 +00:00
Refactor extractors and formatters for improved structure and functionality
- Converted static methods to instance methods in FileInfoExtractor and FilenameExtractor for better encapsulation. - Enhanced MediaInfoExtractor to initialize with file path and extract media information upon instantiation. - Updated MetadataExtractor to handle metadata extraction with improved error handling and added methods for meta type detection. - Introduced ColorFormatter for consistent text formatting across the application. - Refactored MediaFormatter to utilize the new extractor structure and improve output formatting. - Removed redundant utility functions and replaced them with direct calls in extractors. - Added ProposedNameFormatter for better handling of proposed filename formatting. - Updated extension handling to use MEDIA_TYPES for descriptions instead of VIDEO_EXT_DESCRIPTIONS.
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from pathlib import Path
|
||||
from ..constants import VIDEO_EXT_DESCRIPTIONS
|
||||
from ..constants import MEDIA_TYPES
|
||||
|
||||
|
||||
class ExtensionExtractor:
|
||||
@@ -13,4 +13,4 @@ class ExtensionExtractor:
|
||||
@staticmethod
|
||||
def get_extension_description(ext_name: str) -> str:
|
||||
"""Get description for extension"""
|
||||
return VIDEO_EXT_DESCRIPTIONS.get(ext_name, f'Unknown extension .{ext_name}')
|
||||
return MEDIA_TYPES.get(ext_name, {}).get('description', f'Unknown extension .{ext_name}')
|
||||
Reference in New Issue
Block a user