Refactor code structure for improved readability and maintainability

This commit is contained in:
sha
2026-01-05 17:11:42 +00:00
parent b4b7709f25
commit 2e5cef4424
8 changed files with 96 additions and 23 deletions
+5 -3
View File
@@ -83,10 +83,12 @@ class FileInfoExtractor:
return str(self._file_path)
@cached_method()
def extract_extension(self) -> str:
def extract_extension(self) -> str | None:
"""Extract file extension without the dot.
Returns:
File extension in lowercase without leading dot (e.g., "mkv", "mp4")
File extension in lowercase without leading dot (e.g., "mkv", "mp4"),
or None if no extension exists
"""
return self._file_path.suffix.lower().lstrip('.')
ext = self._file_path.suffix.lower().lstrip('.')
return ext if ext else None