20 Commits

Author SHA1 Message Date
Copilot
e535809e74 fix: Fix deadlock in ConvertChapter when context cancelled during page processing (#152)
* Initial plan

* Fix deadlock in ConvertChapter when context is cancelled after wgConvertedPages.Add

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>

* Fix test comments to remove placeholder issue references

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-20 14:26:33 -05:00
copilot-swe-agent[bot]
44e2469e34 Consolidate all common flags into flags.go
- Create individual setup functions for each common flag (quality, override, split, timeout)
- Create setupCommonFlags function that sets up all common flags in one call
- Simplify optimize_command.go and watch_command.go by using setupCommonFlags
- All flags now centralized in flags.go for better maintainability
- All tests continue to pass

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:38:58 +00:00
copilot-swe-agent[bot]
b80535d211 Fix formatting in setupTestCommand function
- Remove extra blank line after t.Helper() for Go formatting consistency

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:28:36 +00:00
copilot-swe-agent[bot]
3a2fb2a97e Add comprehensive documentation to shared functions
- Add detailed docstring to setupFormatFlag explaining parameters and usage
- Add detailed docstring to setupTestCommand explaining return values
- Use constant.DefaultConversion instead of hard-coded constant.WebP for better maintainability
- Clarify when bindViper should be true vs false

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:27:28 +00:00
copilot-swe-agent[bot]
c5de49a310 Refactor tests to use shared setupFormatFlag and helper function
- Create setupTestCommand helper function to reduce test duplication
- Update all format flag tests to use shared setupFormatFlag function
- Remove unused enumflag import from test file
- Ensures test consistency with production code
- All tests continue to pass

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:25:59 +00:00
copilot-swe-agent[bot]
cd0f056648 Eliminate code duplication with shared setupFormatFlag function
- Extract format flag setup logic into shared flags.go file
- Create setupFormatFlag function to eliminate duplication between optimize and watch commands
- Add bindViper parameter to support different flag binding strategies
- Remove duplicate enumflag imports from command files
- All tests continue to pass

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:22:58 +00:00
copilot-swe-agent[bot]
a2feca6cca Fix format flag crash and add comprehensive tests
- Remove NoOptDefVal which caused the format flag to fail with space-separated values
- Add 5 comprehensive unit tests for format flag: space syntax, short form, equals syntax, default value, and case-insensitive
- Update README with detailed format flag documentation and examples
- Format flag now works with all syntaxes: --format webp, -f webp, --format=webp
- Default value (webp) is preserved and shown in help text

Co-authored-by: Belphemur <197810+Belphemur@users.noreply.github.com>
2025-12-10 20:19:10 +00:00
Antoine Aflalo
f08e8dad7b fix: releasing app 2025-09-09 19:36:05 -04:00
Antoine Aflalo
e0c8bf340b ci: add test preparation 2025-09-09 09:58:50 -04:00
Antoine Aflalo
6205e3ea28 feat(gif): support gif file
See .gif file extension support and more exception handling
Fixes #105
2025-09-03 21:04:51 -04:00
Antoine Aflalo
9bca0ceaf4 fix: add autocomplete defintion for log level 2025-08-26 22:39:23 -04:00
Antoine Aflalo
c2a6220fde fix(logging): fix logging parameter not taken into account 2025-08-26 22:36:23 -04:00
Antoine Aflalo
e26cf7a26a fix: test 2025-08-26 21:37:51 -04:00
Antoine Aflalo
4e5180f658 feat: add timeout option for chapter conversion to prevent hanging on problematic files
fixes #102
2025-08-26 21:34:52 -04:00
Antoine Aflalo
32c009ed9b feat: integrate zerolog for enhanced logging across multiple components 2025-08-26 21:16:54 -04:00
Antoine Aflalo
94fb60c5c6 feat: enhance logging capabilities with zerolog integration and command-line support 2025-08-26 21:07:48 -04:00
Antoine Aflalo
dfee46812d feat: use Zerolog for logging. 2025-08-26 20:55:34 -04:00
Antoine Aflalo
989ca2450d feat: support CBR files in optimize and watch commands
Fixes #75
2025-06-12 09:18:06 -04:00
Antoine Aflalo
efe1696bfa fix(memory): fix possible memory leak and add better tests 2025-02-13 20:02:45 -05:00
Antoine Aflalo
dd7b6a332c refactor: update import paths to use internal package 2025-02-13 19:43:18 -05:00