Enhance project structure and add new files for enrichment and analysis
- Updated AGENTS.md to reflect changes in CLI commands and module organization, including the addition of an enrichment step and new functional modules. - Introduced analysis.json, identities.json, inventory.csv, and plan.json to support enriched metadata and execution planning. - Added CODE_IMPROVEMENTS.md to document identified code issues and proposed solutions for future enhancements. - Updated README.md to include new enrichment features and configuration options. - Removed unused dependency on ffmpeg-python from pyproject.toml. These changes improve the overall functionality and maintainability of the Video Library Manager project.
This commit is contained in:
+23
-6
@@ -9,6 +9,11 @@ from typing import Optional
|
||||
|
||||
from vlm.models import MovieIdentity, SeriesIdentity
|
||||
|
||||
# Default extensions used when extensions param is not provided (matches config default)
|
||||
DEFAULT_VIDEO_EXTENSIONS = [
|
||||
".mp4", ".mkv", ".avi", ".mov", ".wmv", ".flv", ".webm", ".m4v"
|
||||
]
|
||||
|
||||
|
||||
# Quality tags to remove from titles
|
||||
QUALITY_TAGS = [
|
||||
@@ -80,7 +85,10 @@ def normalize_title(title: str) -> str:
|
||||
return title.strip()
|
||||
|
||||
|
||||
def parse_movie(filename: str) -> MovieIdentity:
|
||||
def parse_movie(
|
||||
filename: str,
|
||||
extensions: Optional[list[str]] = None,
|
||||
) -> MovieIdentity:
|
||||
"""Parse a movie filename to extract title and year.
|
||||
|
||||
Supports patterns:
|
||||
@@ -91,14 +99,17 @@ def parse_movie(filename: str) -> MovieIdentity:
|
||||
|
||||
Args:
|
||||
filename: Movie filename to parse
|
||||
extensions: Video extensions to strip (default: DEFAULT_VIDEO_EXTENSIONS)
|
||||
|
||||
Returns:
|
||||
MovieIdentity with extracted information
|
||||
"""
|
||||
if extensions is None:
|
||||
extensions = DEFAULT_VIDEO_EXTENSIONS
|
||||
# Remove file extension
|
||||
name_without_ext = filename
|
||||
for ext in ['.mp4', '.mkv', '.avi', '.mov', '.wmv', '.flv', '.webm', '.m4v']:
|
||||
if name_without_ext.lower().endswith(ext):
|
||||
for ext in extensions:
|
||||
if name_without_ext.lower().endswith(ext.lower()):
|
||||
name_without_ext = name_without_ext[:-len(ext)]
|
||||
break
|
||||
|
||||
@@ -148,7 +159,10 @@ def parse_movie(filename: str) -> MovieIdentity:
|
||||
)
|
||||
|
||||
|
||||
def parse_series(filename: str) -> SeriesIdentity:
|
||||
def parse_series(
|
||||
filename: str,
|
||||
extensions: Optional[list[str]] = None,
|
||||
) -> SeriesIdentity:
|
||||
"""Parse a series filename to extract title, season, and episode numbers.
|
||||
|
||||
Supports patterns:
|
||||
@@ -160,14 +174,17 @@ def parse_series(filename: str) -> SeriesIdentity:
|
||||
|
||||
Args:
|
||||
filename: Series filename to parse
|
||||
extensions: Video extensions to strip (default: DEFAULT_VIDEO_EXTENSIONS)
|
||||
|
||||
Returns:
|
||||
SeriesIdentity with extracted information
|
||||
"""
|
||||
if extensions is None:
|
||||
extensions = DEFAULT_VIDEO_EXTENSIONS
|
||||
# Remove file extension
|
||||
name_without_ext = filename
|
||||
for ext in ['.mp4', '.mkv', '.avi', '.mov', '.wmv', '.flv', '.webm', '.m4v']:
|
||||
if name_without_ext.lower().endswith(ext):
|
||||
for ext in extensions:
|
||||
if name_without_ext.lower().endswith(ext.lower()):
|
||||
name_without_ext = name_without_ext[:-len(ext)]
|
||||
break
|
||||
|
||||
|
||||
Reference in New Issue
Block a user