summaryrefslogtreecommitdiff
path: root/internal/anki
AgeCommit message (Collapse)Author
2026-04-02task 00g/00k/00h/008: gofmt, remove ProviderWithFallback, stdlib helpers, ↵Paul Buetow
shared prompt - task 00g: fix gofmt violations (trailing whitespace, missing newlines, indentation) in 8 files; all pass gofmt -l now - task 00k: remove unused ProviderWithFallback and its tests (YAGNI — no production caller existed; voice-level fallback via RunWithVoiceFallbacks already covers the real use case) - task 00h: replace private splitLines/trimSpace/isSpace helpers in internal/batch/processor.go with strings.Split+ReplaceAll and strings.TrimSpace from the stdlib; remove the now-redundant tests - task 008: extract buildEducationalPrompt into internal/image/prompt.go so the prompt-assembly policy (scene truncation cascade, char limit) lives in one place; both OpenAIClient and NanoBananaClient delegate to it Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-02task 003: handle home-dir and APKG marshal errorsPaul Buetow
2026-04-01Fix multi-voice audio path resolutionPaul Buetow
2026-03-08test(task-374): fix errcheck issues in tests and support codePaul Buetow
2026-03-08fix(task-373): handle runtime cleanup errors in production pathsPaul Buetow
2026-03-08fix: complete code-quality task queue (373-378)Paul Buetow
2026-01-21improve: better audio player UI and debugging for bg-bg cardsPaul Buetow
- Add debug logging to navigation.go to diagnose audio file loading issues Prints paths being checked and whether files are found - Improve AudioPlayer UI for Bulgarian-Bulgarian cards: - Add labels showing 'Front' and 'Back' for bg-bg audio buttons - Labels only show when audio files are actually loaded - Better visual distinction between the two playable audios - Reorganized button layout with VBox for cleaner appearance - Track bg-bg state in AudioPlayer (isBgBg field) - Automatically set when back audio file is loaded - Used to determine when to show labels This makes it clearer that Bulgarian-Bulgarian cards have two independently playable audio outputs, and helps debug why audio isn't being loaded.
2025-08-02add timestamps to .apkg exports and num of cardsv0.7.5Paul Buetow
2025-08-02bump version...v0.7.4Paul Buetow
2025-08-02also export reverse cards via apkgPaul Buetow
2025-07-20test: add comprehensive test suite for audio and anki packagesPaul Buetow
- Add tests for audio package (62.8% coverage) - OpenAI provider tests with mocking - Provider interface and fallback mechanism tests - Bulgarian text validation tests - Audio caching functionality tests - Add tests for anki package (84.8% coverage) - CSV generation tests - APKG package generation tests - Card management and formatting tests - Directory scanning and media handling tests - Add test utilities and mocks - Mock implementations for external dependencies - Test helpers for common operations - Utilities for creating test directories and files - Update Taskfile.yaml with comprehensive test targets - test: Run all tests - test-verbose: Run with verbose output - test-coverage: Run with coverage report - test-coverage-html: Generate HTML coverage report - test-race: Run with race detector - test-short: Run only short tests - test-all: Comprehensive suite with coverage and race detection - clean: Remove build artifacts and test files - Fix existing image package tests - Remove tests for non-existent methods - Update tests to match actual implementation - Skip tests requiring live OpenAI API This provides a solid foundation for ensuring code quality and catching regressions. 🤖 Generated with [opencode](https://opencode.ai) Co-Authored-By: opencode <noreply@opencode.ai>
2025-07-19feat: improve flashcard storage and audio regenerationv0.6.0Paul Buetow
- Change default card storage from ~/Downloads to ~/.local/state/totalrecall/cards/ - Keep .apkg exports in ~/Downloads for user convenience - Fix audio regeneration to use random voice and speed (0.9-1.0) - Fix GNOME dock icon by updating StartupWMClass to "Totalrecall" - Fix navigation to properly find cards in new XDG state directory - Ensure config defaults are properly filled when using GUI mode - Bump version to 0.6.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: use unique filenames in Anki exports by prefixing with card IDPaul Buetow
- Fixed issue where all cards used the same filenames (audio.mp3, image.jpg) - Now prefixes media files with card ID (directory name) in Anki exports - Updated both CSV and APKG generators to use unique names - Ensures Anki properly associates correct media with each card - Files in directories remain unchanged, only Anki references are prefixed 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: use timestamp+hash naming for directories in CLI to match GUIPaul Buetow
- Updated CLI code to use internal.GenerateCardID() for directory names - Changed file naming to match GUI: word.txt, translation.txt, audio.mp3, image.jpg/png - Created internal/utils.go with shared GenerateCardID and SanitizeFilename functions - Fixed all references to use the new naming system consistently - Ensures both CLI and GUI use the same directory and file naming convention 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: improve APKG export functionalityv0.4.0Paul Buetow
- Fix Anki import errors by adding missing deck fields (newToday, revToday, etc.) - Fix media files not displaying/playing by using original filenames in cards - Add phonetic information to notes field with proper line breaks - Add 'e' hotkey for quick APKG export - Increment version to 0.4.0 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: complete APKG format with all required Anki fieldsPaul Buetow
Based on Anki-Android database documentation: - Added 'autoplay' field to deck configuration - Added 'dyn' field to deck configuration - Added 'separate' field to new card settings - Added 'minSpace' field to review settings - Added 'replayq' field for replay queue - Added 'tags' array to note type - Added LaTeX pre/post fields for math support - Added 'media' arrays to all field definitions - Added missing collection config fields (schedVer, collapseTime, etc.) - Fixed 'ivlFct' field in review settings - Added 'bury' flags to new and review sections This should resolve all JSON parsing errors when importing APKG files into Anki desktop. Reference: https://github.com/ankidroid/Anki-Android/wiki/Database-Structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18fix: Anki import error - add missing fields to deck configPaul Buetow
- Added missing 'id' field to deck configuration (dconf) - Added required fields to deck options: perDay, order, leechFails, etc. - Added missing fields to note type: sortf, req, vers - Fixed req field format to use interface{} for mixed types - Removed duplicate 'did' field in note type config - Added 'dyn', 'conf', and 'usn' fields to deck definitions This fixes the '500: JsonError missing field id' error when importing APKG files into Anki desktop. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-18feat: major refactor - APKG export support and subdirectory organizationPaul Buetow
Major Features: - Added native .apkg (Anki package) export format with embedded media - Reorganized file structure to use subdirectories per word - Enhanced GUI export dialog with format selection (APKG/CSV) APKG Export Implementation: - Created apkg_generator.go with full SQLite-based Anki package generation - Includes custom card templates with professional CSS styling - Front side: Image + English word - Back side: Image + Bulgarian word + Audio + Notes - All media files automatically embedded in package - Custom deck names supported via --deck-name flag Directory Structure Changes: - Each word now gets its own subdirectory (e.g., anki_cards/ябълка/) - All related files (audio, images, translations, prompts) stored together - Cleaner organization and easier management - Prevents file naming conflicts GUI Updates: - Export dialog no longer shows file browser, exports directly to anki_cards - Format selection between APKG (recommended) and CSV (legacy) - Fixed navigation to properly load image prompts from subdirectories - Delete function now moves entire word directory to trash CLI Updates: - --anki flag now generates APKG by default - --anki-csv flag for legacy CSV format - All file generation uses subdirectory structure Bug Fixes: - Fixed handling of multi-word entries (e.g., "картоф картофи") - Fixed GenerateFromDirectory to properly handle words with underscores - Fixed phonetic files being treated as separate cards - Fixed image prompt preservation during navigation Breaking Changes: - File structure changed from flat to subdirectory-based - Existing files need to be reorganized into subdirectories 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-16only one img per cardPaul Buetow
2025-07-15feat: add English translations and detailed attribution filesPaul Buetow
- Automatic Bulgarian to English translation for all words - Save translations to separate _translation.txt files - Include translations in Anki CSV export - Add detailed attribution files for audio and images: - Audio: model, voice, speed, instructions, processed text - Image: model, size, quality, style, full prompt used - Expand image styles to 42 different options (including superhero comic, yoga, etc.) - Improve image prompts to strongly avoid text generation - Fix image overwrite issue - now overwrites existing files instead of failing 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-14initial commitPaul Buetow