Following design approved by architect in docs/design/v1.4.0/ Changes to starpunk/media.py: - Update delete_media() to fetch and delete variant files from disk - Query media_variants table before deletion for file paths - Use best-effort cleanup with try/except for each file - Log individual file deletion failures as warnings - Update final log to show total files deleted (original + variants) - Update module docstring to reflect v1.4.0 capabilities: * 50MB max upload, 10MB max output * Image variants (thumb, small, medium, large) * Tiered resize strategy This fixes the issue where variant files were left orphaned on disk when media was deleted. The database CASCADE already deleted variant records, but the physical files remained. All tests pass: uv run pytest tests/test_media_upload.py -v (23/23) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
20 KiB
20 KiB