diff --git a/.gitignore b/.gitignore index bf210e3..01e9061 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .DS_Store .DS_Store videoarchiver/tmp/ -__pycache__ \ No newline at end of file +__pycache__ +cline_docs \ No newline at end of file diff --git a/cline_docs/activeContext.md b/cline_docs/activeContext.md index 9351c63..1bdebb0 100644 --- a/cline_docs/activeContext.md +++ b/cline_docs/activeContext.md @@ -1,11 +1,13 @@ # Active Context ## Current Focus + - Adding fallback import patterns to all non-init Python files - Maintaining relative imports while ensuring compatibility with Red-DiscordBot loading - Implementing consistent import patterns across the entire codebase ## Recent Changes + - Added fallback imports in core module files: - base.py - cleanup.py @@ -21,6 +23,7 @@ - __init__.py ## Next Steps + 1. Add fallback imports to database module files: - connection_manager.py - query_manager.py @@ -74,9 +77,11 @@ - __init__.py ## Active Files + Currently working through database module files ## Strategy + - Process one module at a time - Update files systematically - Commit changes per module diff --git a/videoarchiver/ffmpeg/encoder_params.py b/videoarchiver/ffmpeg/encoder_params.py index 1de5ea5..217dcaf 100644 --- a/videoarchiver/ffmpeg/encoder_params.py +++ b/videoarchiver/ffmpeg/encoder_params.py @@ -3,10 +3,17 @@ import os import logging from typing import Dict, Any -from .exceptions import CompressionError, QualityError, BitrateError + +try: + # Try relative imports first + from .exceptions import CompressionError, QualityError, BitrateError +except ImportError: + # Fall back to absolute imports if relative imports fail + from videoarchiver.ffmpeg.exceptions import CompressionError, QualityError, BitrateError logger = logging.getLogger("VideoArchiver") + class EncoderParams: """Manages FFmpeg encoding parameters based on hardware and content"""