Commit Graph

250 Commits

Author SHA1 Message Date
opswhisperer 52a1d19df2 working kobo provider 2025-09-13 14:28:38 -07:00
TEC 0d2ce74fa3 Remove stray </div> from config_edit 2025-09-13 14:12:22 +08:00
TEC 5475cefa53 Fix broken jinja template in config_edit
This template was mis-edited in 276e7b29ca.
2025-09-13 14:07:39 +08:00
crocodilestick 08e4b717f5 Fix PR #632: Improve metadata provider global enable/disable functionality
- 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
2025-09-12 23:51:32 +02:00
crocodilestick f35a06f27d Added timeouts to all metadata provider requests to prevent application hangs
[Feature Request]An option disable metadata provider(s)
Fixes #629
2025-09-12 23:35:50 +02:00
crocodilestick 7d3f411da4 feat: implement global enablement for metadata providers with UI controls 2025-09-12 23:14:18 +02:00
crocodilestick 42e7aabe5f feat: Add retained formats functionality for auto-conversion
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.
2025-09-12 21:34:32 +02:00
crocodilestick 276e7b29ca fix: Improve OAuth setup UX and resolve container stalling issue
- 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
2025-09-12 21:09:46 +02:00
crocodilestick 4453fd939c Merge branch 'main' of https://github.com/crocodilestick/Calibre-Web-Automated 2025-09-12 17:42:53 +02:00
crocodilestick d2c018ea5d Fix ingest service failure when Google Drive sync is disabled (#621)
- 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
2025-09-12 16:50:59 +02:00
crocodilestick 7c58906e53 feat: Implement configurable duplicate detection system (#604)
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
2025-09-12 16:26:22 +02:00
crocodilestick ea356a464e [bug] Duplicate Manager shows Book in 2 languages
Fixes #604
2025-09-12 16:13:10 +02:00
crocodilestick 2d19686d77 [bug] Default permissions on ingest folder don't support upload
Fixes #603
2025-09-12 15:56:35 +02:00
crocodilestick f40503ff73 Changed instances throughout codebase where default theme was not caliBlur.
[bug] Switch default theme to caliBlur since light theme is being deprecated
Fixes #602
2025-09-12 15:42:00 +02:00
crocodilestick f1916a172a Fix startup stalling issues in v3.1.4 (Issue #587)
- 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.
2025-09-12 15:32:23 +02:00
CrocodileStick c9541c3030 Merge branch 'main' into patch-1 2025-09-12 10:16:38 +02:00
CrocodileStick 3dc474cd80 Merge pull request #617 from a-eukarya/patch-1
Update: messages.po (KO)
2025-09-10 20:48:39 +02:00
CrocodileStick df7f63d57b Merge pull request #612 from nstwfdev/feature/ru_translations
Add translations for 'ru' language
2025-09-10 20:47:12 +02:00
crocodilestick a6a13810af Fixed syntax errors 2025-09-10 20:45:01 +02:00
crocodilestick 73439569ae Fixed syntax error in german translations 2025-09-10 20:35:37 +02:00
CrocodileStick f16a5b85ad Merge pull request #607 from spezzino:feature/toggle-password-visibility
Add toggle to show/hide password
2025-09-10 20:29:08 +02:00
CrocodileStick b622bb0b1a Merge pull request #596 from electric-m:germanpatch-1
Additions to and improvement of the German translation.
2025-09-10 20:28:29 +02:00
CrocodileStick 77b8867948 Merge pull request #601 from ugyes:patch-2
Update messages.po (HU)
2025-09-10 20:28:06 +02:00
crocodilestick 9a98a82bab Further fixes to text inputs and checkboxes 2025-09-10 20:26:48 +02:00
crocodilestick a1ca6a7221 Redesigned edit books page to look better on all devices and be easier to use 2025-09-10 20:26:01 +02:00
crocodilestick 1a93a33f8e Fixed checkboxes in CWA settings 2025-09-10 20:25:07 +02:00
crocodilestick 1b9ed890bf [bug] theme makes checkboxes difficult to see if checked or unchecked
Fixes #605
2025-09-10 20:24:03 +02:00
Sven Fischer 0b9f312f41 update 🇩🇪 translations in messages.po 2025-09-09 20:20:05 +02:00
Strubbl 5d4fb03fe9 Update 🇩🇪 messages.po
update German strings
2025-09-08 23:17:04 +02:00
a-eukarya 9b29ef90bd Korean Locale Update: messages.po
Updated some strings (E. g. Calibre-Web -> Calibre-Web Automated) and added Korean translation for untranslated strings.
2025-09-08 01:00:28 +09:00
Timur Sadullayev 264699b29c Add translations for 'ru' language 2025-09-06 03:49:42 -04:00
crocodilestick b43cac0bbb Fix HTTP 500 error in advanced search due to incorrect Pagination parameter
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
2025-09-05 16:20:39 +02:00
crocodilestick 55af1c5412 Fix lubimyczytac metadata provider returning empty results on parse failures
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
2025-09-05 16:05:46 +02:00
crocodilestick 09689ebb03 Made it so that the new send to ereader modal shows up even for users with only 1 email address on their account 2025-09-05 15:47:17 +02:00
crocodilestick 8402e3225e Added the ability to select which fields can be overwritten by the automatic metadata fetching service, for both the smart and verbatim modes 2025-09-05 15:46:42 +02:00
Stefano Pezzino f1a8d81ad6 Add toggle to show/hide password 2025-09-05 20:35:32 +10:00
crocodilestick 3e3d2e5e4d feat: Implement auto-send and enhanced auto-metadata fetch systems
## 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.
2025-09-04 18:22:54 +02:00
crocodilestick a386604c43 Added light mode backgrounds for caliBlur 2025-09-04 18:14:26 +02:00
crocodilestick df1173fe8f Fixed ill-aligned sort element in first column of book list table 2025-09-04 15:38:40 +02:00
crocodilestick f25650666b Changed metadata enforcement system to only trigger when meaningful metadata changes have been made.
Fixes #599
2025-09-04 14:46:45 +02:00
crocodilestick 3f25c24d92 Fixed send to ereader menu styling and added ability to enter emails not already saved to the users account 2025-09-04 12:58:50 +02:00
ugyes 19682fc9cc Update messages.po
Hungarian translation update and correction
2025-09-04 12:07:38 +02:00
crocodilestick 57a741e71a Added Send-to-Ereader menu to the book details page 2025-09-04 11:27:01 +02:00
Michael cddc134d50 Additions to and improvement of the German translation. 2025-09-03 21:13:32 +02:00
crocodilestick 931ad20fa6 Fixed issues with translations 2025-09-03 15:17:03 +02:00
crocodilestick 54955f4e7f Fixed styling of new duplicates page 2025-09-03 14:40:35 +02:00
crocodilestick f1085e4602 Made it so that the Duplicates sidebar option is displayed for new and existing users alike 2025-09-03 14:11:54 +02:00
Dome 3d06da434c Merge branch 'main' into main 2025-09-03 07:22:26 +00:00
Hot Garbage 9cecbaf096 Add default Instapaper config values to kobo.py
Latest firmware version writes empty values for Instapaper parameters if missing from the /initialization response. Add default values to `NATIVE_KOBO_RESOURCES`
2025-09-02 10:36:21 -07:00
crocodilestick cf666f58c1 feat: Upgrade to Python 3.13 with full compatibility and modernization
- 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
2025-09-02 18:32:32 +02:00