Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow direct pdf archives #942

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft

feat: allow direct pdf archives #942

wants to merge 23 commits into from

Conversation

fmartingr
Copy link
Member

@fmartingr fmartingr commented Jun 25, 2024

This pull request aims to provide PDF archives for bookmarks by directly downloading the file.

Notable changes

  • Logic for archivers now uses the ArchiverDomain
    • ArchiverDomain initializes a list of archivers that try to match the content type, if it does, that archiver is used. If an error is raised, the next archiver is used and so on.
  • Added PDFArchiver: Just downloads the file.
  • Added WARCArchiver as a "catch all" (current default)
  • Added database columns bookmark.archiver (warc/pdf) and archive_path.
    • Bookmark has an archive if archive_path != ""

Pending

  • Migrate the archive_path for existing bookmarks: iterate over the bookmarks, check if the archive exists and set the path and the archiver to warc.
  • Refactor EPub logic separate from the archiver
  • Allow different archivers in archive page
  • Tests
  • e2e tests?

Closes #929

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 43.26923% with 236 lines in your changes missing coverage. Please review.

Project coverage is 35.59%. Comparing base (617f5dd) to head (ddbac3c).

Files with missing lines Patch % Lines
...ernal/database/migrations/0001_migrate_archiver.go 37.07% 54 Missing and 2 partials ⚠️
internal/domains/archiver.go 11.76% 45 Missing ⚠️
internal/archiver/pdf.go 12.50% 28 Missing ⚠️
internal/webserver/handler-api-ext.go 0.00% 27 Missing ⚠️
internal/http/routes/api/v1/bookmarks.go 0.00% 19 Missing ⚠️
internal/domains/storage.go 0.00% 17 Missing ⚠️
internal/archiver/warc.go 63.41% 10 Missing and 5 partials ⚠️
internal/webserver/handler-api.go 0.00% 11 Missing ⚠️
internal/cmd/add.go 0.00% 10 Missing ⚠️
internal/model/archiver.go 88.57% 4 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #942      +/-   ##
==========================================
+ Coverage   34.74%   35.59%   +0.85%     
==========================================
  Files          61       65       +4     
  Lines        5322     5557     +235     
==========================================
+ Hits         1849     1978     +129     
- Misses       3249     3349     +100     
- Partials      224      230       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fmartingr fmartingr self-assigned this Oct 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow PDF file archives
1 participant