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 22 commits into
base: master
Choose a base branch
from
Draft

feat: allow direct pdf archives #942

wants to merge 22 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 45.65826% with 194 lines in your changes missing coverage. Please review.

Project coverage is 36.49%. Comparing base (8c35a6b) to head (041526f).

Files with missing lines Patch % Lines
...ernal/database/migrations/0001_migrate_archiver.go 39.18% 43 Missing and 2 partials ⚠️
internal/domains/archiver.go 11.36% 39 Missing ⚠️
internal/webserver/handler-api-ext.go 0.00% 24 Missing ⚠️
internal/archiver/pdf.go 20.83% 19 Missing ⚠️
internal/http/routes/api/v1/bookmarks.go 0.00% 17 Missing ⚠️
internal/domains/storage.go 0.00% 13 Missing ⚠️
internal/webserver/handler-api.go 0.00% 11 Missing ⚠️
internal/archiver/warc.go 65.51% 5 Missing and 5 partials ⚠️
internal/cmd/add.go 0.00% 9 Missing ⚠️
internal/model/archiver.go 86.20% 4 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #942      +/-   ##
==========================================
+ Coverage   35.33%   36.49%   +1.16%     
==========================================
  Files          61       65       +4     
  Lines        4078     4277     +199     
==========================================
+ Hits         1441     1561     +120     
- Misses       2414     2487      +73     
- Partials      223      229       +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