Repository navigation
feat(fetcher): add random_cat — random cat picture from cataas.com - #191
Conversation
Image-only fetcher, Safety::Safe (host hardcoded to cataas.com so config can't redirect traffic). Each refresh downloads a fresh cat to `$SPLASHBOARD_HOME/cache/cats/<key>.<ext>` (PNG / JPEG / GIF / WebP via magic-byte detection). Optional `tag` filter for cataas.com tags. Ticks `random_cat` box on #67. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughA new RandomCatFetcher has been added to download random cat images from cataas.com with optional tag filtering. The fetcher includes image type detection, 5MB size capping, automatic caching with stale file cleanup, and is registered in the built-in fetcher registry. Changes
Possibly related PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 60 minutes.Comment |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #191 +/- ##
==========================================
- Coverage 81.92% 81.79% -0.13%
==========================================
Files 139 140 +1
Lines 29486 29690 +204
==========================================
+ Hits 24157 24286 +129
- Misses 5329 5404 +75
🚀 New features to boost your workflow:
|
Summary
cataas.comeach refresh cycle and exposes it asBody::Image. Caches to$SPLASHBOARD_HOME/cache/cats/<key>.<ext>.Safety::Safe: host hardcoded tocataas.com(config can't redirect traffic), no auth (no token to leak). Mirrors thegithub_avatarfixed-host stance fromproject_trust_model.md.tagoption for cataas.com tag filtering (cute/orange/kitten/cute,fatAND-join). Empty / whitespace falls through to "any cat".random_catcheckbox on meta: fetcher roadmap - Social & Media #67.Reference
imageOptions
tagcute,orange,kitten). Omit for any cat.Compatible renderers
imageanimated_boot,animated_postfx,animated_scanlines,animated_splitflap,animated_wave,media_imageImplementation notes
image::ImageReader::opendecodes by extension hint, so the cached file's suffix must match the actual format.<key>.<ext>siblings before the new write so a stale file with a different suffix can't mislead the renderer.,for multi-tag AND).Test plan
cargo fmt --all -- --checkcargo clippy --all-targets -- -D warningscargo test(1227+ green)cargo xtaskregeneratesdocs-site/src/content/docs/reference/fetchers/random/random_cat.mdcleanlymedia_image(default tag,cute,orange) — three cats render side by sidecargo test -- --ignored fetcher::random_cat::tests::live --nocapture🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes