fix(viewer): show the tile's own icon when a thumbnail cannot be made - #437
Conversation
Some videos cannot be decoded, or take longer than the 15s the viewer allows, so the thumbnail answers 404 and the grid painted the browser's broken-image glyph with the file name across the tile. The tile already draws a play or picture icon while it waits its turn, so a tile that fails now keeps that icon instead. The record is cleared with the view, so a file that failed once is retried the next time it is opened. Version 8.9.2.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (8)
Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review. 📝 WalkthroughWalkthroughThe release updates project and Docker version references from 8.9.1 to 8.9.2. Gallery tiles now record failed thumbnails, display fallback icons, and clear failure state when the view resets. ChangesGallery thumbnail failure handling
Release version alignment
Priority: ⬇️ Low — Impact reflects low issue severity. Estimated code review effort: 2 (Simple) | ~10 minutes Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to Gallery tiles now retain meaningful fallback icons when thumbnails fail, while failed files can be retried after changing views. The release version references are aligned, with no remaining concrete merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. (5 skipped: 5 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Warning Some tools did not complete. Review the errors below. 🔧 ast-grep (0.45.2)src/web/templates/index.htmlast-grep timed out on this file 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. Comment |
|
🐳 Dev images published!
The dev/test instance will pick up these changes automatically (Portainer GitOps). To test locally: docker pull drumsergio/telegram-archive:dev
docker pull drumsergio/telegram-archive-viewer:dev |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #437 +/- ##
=======================================
Coverage 94.60% 94.60%
=======================================
Files 29 29
Lines 11447 11447
=======================================
Hits 10829 10829
Misses 618 618
🚀 New features to boost your workflow:
|
One tile in the shared media grid came up as the browser's broken-image glyph with a filename printed across it.
That happens when the viewer cannot produce a thumbnail at all: the video is undecodable, or ffmpeg takes longer than the 15 seconds it is given, so the request answers 404 and the
<img>has nothing to draw.The tile already has a picture for exactly that situation. While it waits its turn in the queue it shows a play symbol for video and a picture symbol for anything else, and that is what it now keeps when the thumbnail fails. The failure is remembered only for the current view, so switching tab or chat clears it and the file is tried again next time.
Testing
tests/test_gallery_thumb_batching.pygains a case that runs the real queue: an errored tile is recorded, stays admitted so the queue does not re-issue it, frees its slot exactly like a successful load, cannot be resurrected by a later load event, and does not survive a view change.settleThumb, dropping!thumbFailed(item.id)from the tile, and leaving the failure set uncleared on reset.ruff checkandruff format --checkclean.Summary by CodeRabbit
Bug Fixes
Documentation