- Fix critical circular import between cwa_functions.py and search_metadata.py
- Add unified JSON parsing utility for metadata_providers_enabled setting
- Enhance error handling for null/empty values and malformed JSON
- Improve provider validation with proper attribute checks
- Add early return when no active providers available
- Standardize boolean logic across all provider enable/disable checks
- Remove code duplication across auto_metadata.py, metadata_helper.py, search_metadata.py
Implements ability to keep original book formats after conversion to target format.
Users can now select which formats to retain via CWA settings UI.
Features:
- New auto_convert_retained_formats setting with checkbox grid UI
- Automatic conflict prevention (target format always retained)
- Database migration support for backward compatibility
- Enhanced ingest processor with robust format addition logic
Credit to @angelicadvocate for original implementation concept in PR #284.
Fixes edge cases including race conditions, UI state handling, and iteration safety.
- Fix container stalling during OAuth config save by making network requests non-blocking
- Add explicit callback URI documentation with provider-specific examples
- Enhance OAuth error messages with specific field names and actionable guidance
- Add UI warning when switching from OAuth to standard auth about password requirements
- Improve OAuth testing feedback with detailed endpoint validation
- Fix translation compatibility issues in error messages
- Standardize documentation placeholder domains
- Add comprehensive troubleshooting guide for common OAuth issues
Issues/feedback on new OAUTH setup
Fixes#613
- Add null/empty path checks in gdriveutils.py to prevent TypeError on import
- Enhance exception handling in ingest_processor.py to catch TypeError/AttributeError
- Add session guards to all database functions for graceful degradation
- Ensure ingest service continues working when Google Drive is disabled
[bug] Book not ingested on dev image (main branch)
Fixes#621
Fix issue where books in different languages were incorrectly grouped as duplicates
by implementing a comprehensive configurable duplicate detection system.
Key Changes:
Database Schema:
- Add 6 new duplicate detection settings to cwa_schema.sql:
- duplicate_detection_title/author/language (default: enabled)
- duplicate_detection_series/publisher/format (default: disabled)
Frontend UI:
- Add "CWA Duplicate Detection Criteria" section to cwa_settings.html
- Implement checkbox grid for configuring detection criteria
- Include explanatory text and validation warnings
Core Logic Rewrite:
- Replace hardcoded (title, author) matching with configurable criteria
- Support dynamic key generation based on selected metadata fields
- Add comprehensive error handling and edge case coverage
Robustness Improvements:
- Handle missing/null metadata gracefully with fallback values
- Add safety checks for empty collections and corrupt data
- Include CWA database connection error handling
- Performance warnings for large libraries (50k+ books)
Issue Resolution:
- Books in different languages no longer considered duplicates (language included by default)
- Users can now fully customize duplicate detection criteria
- Maintains backward compatibility with existing duplicate manager
- Comprehensive error handling prevents crashes on edge cases
Technical Details:
- Follows established CWA settings patterns for seamless integration
- Boolean settings automatically handled by existing backend logic
- Added datetime import for timestamp sorting fallbacks
- Extensive null/empty validation throughout duplicate detection pipeline
- Add comprehensive timeouts to prevent infinite hangs in cwa-init and calibre-binaries-setup
- Enhance Qt6 compatibility processing with 60s timeout and better error handling
- Add network operation timeouts (2-3s) for GitHub API calls in version resolution
- Implement environment validation checks at startup to fail fast on missing directories
- Improve calibre installation process with 5-minute timeout and verification steps
- Add detailed logging throughout startup sequence for better debugging
- Fix Qt6 output capture variable to properly report processing results
These changes resolve the reported stalling after cwa-init where calibre-binaries-setup
(formerly universal-calibre-setup) would hang, particularly on systems with older kernels
or network connectivity issues.
Fix TypeError caused by using 'total=' instead of 'total_count=' when
instantiating the Pagination class in advanced search functionality.
The Pagination class constructor expects three parameters:
- page
- per_page
- total_count
However, the advanced search code was incorrectly using 'total=' as the
keyword argument, causing a "got an unexpected keyword argument 'total'"
error when users attempted to use the advanced search feature.
This fix resolves issue #600 by correcting the parameter name in both
pagination instantiation calls within render_adv_search_results().
Fixes: #600
Resolves issue where the "Fetch metadata" feature would show no results
when individual book detail parsing failed, even though initial search
was successful. Now filters out failed results and falls back to basic
search results when all detailed parsing fails.
Fixes#584
## Major Features Added
### 📧 Auto-Send System
- Automatically emails newly ingested books to users' eReaders
- Configurable delay (1-60 minutes) to allow for processing
- Supports multiple formats (EPUB, MOBI, AZW3, KEPUB, PDF)
- Integrates with existing Calibre-Web email configuration
- Respects user preferences and access controls
### 🏷️ Auto-Metadata Fetch System Enhancements
- Enhanced metadata fetching with multiple provider support
- Added smart metadata application mode with intelligent criteria
- Moved control from user-level to admin-only configuration
- Implemented provider hierarchy with drag-and-drop interface
- Added quality-based metadata replacement logic
## Database Schema Changes
### CWA Settings (scripts/cwa_schema.sql)
- Added auto_metadata_smart_application SMALLINT DEFAULT 0
- Enables intelligent vs direct metadata replacement modes
## User Interface Updates
### Admin Interface (cps/templates/cwa_settings.html)
- Added smart metadata application toggle with detailed tooltip
- Enhanced provider hierarchy management
### User Interface (cps/templates/user_edit.html)
- Removed auto_metadata_fetch controls (now admin-only)
- Cleaned up user profile interface
## Smart Metadata Application Logic
### Direct Replacement Mode (Default)
- Takes metadata from preferred provider exactly as provided
- Complete replacement of existing metadata
- Philosophy: "Just take the metadata as is"
### Smart Application Mode (Optional)
- Intelligent criteria for metadata replacement:
* Titles: Only replace if longer/more descriptive
* Descriptions: Only replace if longer/more detailed
* Publishers: Only replace if current field is empty
* Covers: Only replace if higher resolution
* Authors: Always update for consistency
* Tags/Series: Always add for discoverability
## Technical Implementation
### Metadata Helper (cps/metadata_helper.py)
- Enhanced _apply_metadata_to_book() with smart application logic
- Updated fetch_and_apply_metadata() for admin-only control
- Integrated CWA_DB settings checking for both modes
### Ingest Processor (scripts/ingest_processor.py)
- Removed user-based metadata checking
- Streamlined to use admin settings only
- Improved processing pipeline integration
### Form Processing (cps/cwa_functions.py)
- Auto-detection of boolean settings from schema
- Automatic handling of auto_metadata_smart_application
## Provider System Enhancements
- Google Books, Internet Archive, DNB, ComicVine, Douban support
- Priority-based searching with first-success-wins logic
- Quality criteria evaluation for metadata selection
- Configurable provider hierarchy with drag-and-drop interface
## Documentation
### Wiki Pages Created
- Auto-Send-System.md: Comprehensive user and admin guide
- Auto-Metadata-Fetch-System.md: Detailed configuration and usage
- Enhanced with relevant emojis for improved readability
- Covers troubleshooting, best practices, and technical details
## Integration & Compatibility
- Maintains backward compatibility with existing email settings
- Integrates seamlessly with auto-convert and ingest systems
- Respects existing access controls and user permissions
- No breaking changes to existing functionality
## Testing Notes
- Database schema updates will apply automatically on app startup
- Settings form processing handles new boolean field automatically
- Metadata fetching now controlled entirely by admin settings
- User interface cleaned of deprecated metadata controls
This implementation provides a complete automated book delivery and metadata enhancement system while maintaining the principle of admin-controlled automation and user-friendly operation.
Latest firmware version writes empty values for Instapaper parameters if missing from the /initialization response. Add default values to `NATIVE_KOBO_RESOURCES`
- Upgrade base image from Ubuntu Jammy to Noble (24.04 LTS)
- Add deadsnakes PPA for Python 3.13.7 installation
- Update Dockerfile to use Python 3.13 with proper virtual environment setup
- Fix package dependencies (libldap2 vs libldap-2.5-0 for Noble)
- Create comprehensive pyproject.toml with Python 3.10-3.13 support declarations
- Update requirements.txt with conditional dependencies:
* iso-639>=0.4.5,<0.5.0 for Python <3.12
* pycountry>=24.6.1,<25.0.0 for Python >=3.12 (fixes pkg_resources deprecation)
- Update GitHub Actions workflow to use Python 3.13
- Move development documentation to DEV/ directory:
* PYTHON_313_UPGRADE.md
* PYTHON_313_UPGRADE_STATUS.md
* V0.6.25_fixes_analysis.ipynb
Benefits:
- Improved performance and memory efficiency
- Enhanced error messages and debugging
- Future-proof with Python 3.13 support until 2029
- Eliminates pkg_resources deprecation warnings
- Maintains full backward compatibility
Tested: Full Docker build successful, all CWA services operational