mirror of
https://github.com/shadoll/moma.git
synced 2026-08-28 03:27:34 +00:00
- Updated `pyproject.toml` to reflect new package structure. - Created `renamer/__init__.py` to initialize the package. - Implemented `RenamerApp` in `renamer/app.py` for the main application interface. - Added constants for video extensions in `renamer/constants.py`. - Developed `MediaExtractor` class in `renamer/extractor.py` for extracting metadata from media files. - Created various extractor classes in `renamer/extractors/` for handling filename, metadata, and media info extraction. - Added formatting classes in `renamer/formatters/` for displaying media information and proposed filenames. - Implemented utility functions in `renamer/utils.py` for detecting file types and extracting media track information. - Introduced `OpenScreen` in `renamer/screens.py` for user input of directory paths. - Enhanced error handling and user feedback throughout the application.
25 lines
686 B
Python
25 lines
686 B
Python
from pathlib import Path
|
|
|
|
|
|
class FileInfoExtractor:
|
|
"""Class to extract file information"""
|
|
|
|
@staticmethod
|
|
def extract_size(file_path: Path) -> int:
|
|
"""Extract file size in bytes"""
|
|
return file_path.stat().st_size
|
|
|
|
@staticmethod
|
|
def extract_modification_time(file_path: Path) -> float:
|
|
"""Extract file modification time"""
|
|
return file_path.stat().st_mtime
|
|
|
|
@staticmethod
|
|
def extract_file_name(file_path: Path) -> str:
|
|
"""Extract file name"""
|
|
return file_path.name
|
|
|
|
@staticmethod
|
|
def extract_file_path(file_path: Path) -> str:
|
|
"""Extract full file path as string"""
|
|
return str(file_path) |