mirror of
https://github.com/Glitchy-Sheep/boosty-downloader.git
synced 2026-10-14 21:33:23 +00:00
[PR #191] [MERGED] [downloader] Link attachments in post.html and skip unfinished uploads #189
Labels
No labels
api-drift
bug
ci
documentation
enhancement
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Glitchy-Sheep/boosty-downloader#189
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Glitchy-Sheep/boosty-downloader/pull/191
Author: @Glitchy-Sheep
Created: 9/14/2026
Status: ✅ Merged
Merged: 9/15/2026
Merged by: @Glitchy-Sheep
Base:
main← Head:fix/attachments-on-page📝 Commits (4)
ef70045[api] Skip file attachments the author has not finished uploadingce99e0b[downloader] Link attachments in post.htmlc945d28[html] Keep a styled heading in one piece and render line breaks in text74850b9[html] Show the video title and tidy the page templates📊 Changes
24 files changed (+320 additions, -67 deletions)
View changed files
📝
CHANGELOG.md(+11 -0)📝
boosty_downloader/application/mappers/html_converter.py(+6 -0)📝
boosty_downloader/application/mappers/link_header_text.py(+22 -1)📝
boosty_downloader/application/mappers/post_mapper.py(+3 -0)📝
boosty_downloader/application/use_cases/download_single_post.py(+7 -5)📝
boosty_downloader/cli/commands/download.py(+2 -2)📝
boosty_downloader/infrastructure/boosty_api/models/post/post_data_types/post_data_file.py(+3 -0)📝
boosty_downloader/infrastructure/html_generator/models.py(+0 -4)📝
boosty_downloader/infrastructure/html_generator/renderer.py(+6 -2)📝
boosty_downloader/infrastructure/html_generator/templates/audio.html(+1 -1)📝
boosty_downloader/infrastructure/html_generator/templates/base.html(+8 -9)📝
boosty_downloader/infrastructure/html_generator/templates/file.html(+1 -1)📝
boosty_downloader/infrastructure/html_generator/templates/image.html(+1 -1)📝
boosty_downloader/infrastructure/html_generator/templates/text.html(+10 -8)📝
boosty_downloader/infrastructure/html_generator/templates/video.html(+9 -4)📝
docs/concepts/boosty/download-flow.md(+1 -1)📝
test/e2e/download_flow_test.py(+6 -0)📝
test/fixtures/rendered_post.html(+25 -21)📝
test/unit/download_plan/download_plan_test.py(+6 -2)📝
test/unit/html_generator/html_templates_test.py(+23 -2)...and 4 more files
📄 Description
📝 Summary
Audit stage 5, block 1 of 4 (mappers and render): attachments reach the page, unfinished uploads stop failing posts, and two text rendering losses are fixed.
🔧 What changes
Fixed
files/, butpost.htmlnever mentioned them. Every file that downloaded is now a link on its own line at its place in the post, in the author's order; the link opens the file. A failed attachment is left off the page and still does not hold the page back: the page stays a snapshot of the run until pages can be rebuilt from disk (stage 7).complete: false, and its url answers 404. The DTO did not read the flag, so such a post burned 5 attempts of 404, landed in the failed list and re-downloaded its images on every attempt. The mapper now skips the file like an unfinished video or audio, warns about unfinished uploads and marksfilesfor the next run.--dry-runno longer promises such files.\nfragment into<br>. The mapper now gives every line break a fragment of its own.<hN>per fragment and dropped the style. The template now opens the heading on the first fragment of a level and closes it on the last, with bold, italic, underline and links inside.Changed
.audio-titlebecame the shared.media-title.image.htmltakesaltfrom the model and drops the inlinemax-widthstyle; image and file paths go through_media_srclike video and audio, so Windows paths get forward slashes.p,.new-paragraph) and unused model fields (HtmlGenImage.width/height,HtmlGenVideo.poster,HtmlGenFile.title) are gone.🚫 Not changed on purpose
post.html, a failed attachment does not. Linking attachments before they land was considered and dropped: only downloaded files belong on the page.checkstill counts unfinished files in the blog overview:count_mediaworks on DTOs. Backlog.completefield and 335 live posts had no external video to check one against, so nothing to change.📚 Docs
docs/concepts/boosty/download-flow.md: the page links only the attachments that landed.download --help: the note aboutpost_contentwithout the video filters namesfilestoo.🧪 Tests
HtmlGenFileelement; withoutpost_contentin the run it gets none.files/fixture-archive.zip; the retried run pins that a page written before the retry has no link.BLOCK_ENDwith text.<h2>; the showcase golden pins the video title block, the attachment block and the CSS changes.task cigreen locally: ruff, pyright strict, import-linter, 276 tests + e2e.<br>where a space used to be.✅ Checklist
--helpand README if neededdocs/if the download flow or dev process changed## Unreleasedin CHANGELOG.md (or theci/skip-changeloglabel if not user-facing)🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.