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

feat: allow direct pdf archives #942

wants to merge 13 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

Closes #929

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

Attention: Patch coverage is 36.41026% with 124 lines in your changes missing coverage. Please review.

Project coverage is 35.20%. Comparing base (4a5564d) to head (9d34bad).

Current head 9d34bad differs from pull request most recent head 8c1ed87

Please upload reports for the commit 8c1ed87 to get more accurate results.

Files Patch % Lines
internal/http/routes/bookmark.go 11.11% 32 Missing ⚠️
internal/webserver/handler-api-ext.go 0.00% 24 Missing ⚠️
internal/domains/archiver.go 0.00% 15 Missing ⚠️
internal/domains/storage.go 0.00% 13 Missing ⚠️
internal/webserver/handler-api.go 0.00% 10 Missing ⚠️
internal/cmd/add.go 0.00% 9 Missing ⚠️
internal/database/mysql.go 71.42% 4 Missing and 4 partials ⚠️
internal/archiver/pdf.go 41.66% 7 Missing ⚠️
internal/http/routes/api/v1/bookmarks.go 0.00% 4 Missing ⚠️
internal/archiver/warc.go 87.50% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #942      +/-   ##
==========================================
+ Coverage   35.17%   35.20%   +0.02%     
==========================================
  Files          61       63       +2     
  Lines        4065     4116      +51     
==========================================
+ Hits         1430     1449      +19     
- Misses       2413     2443      +30     
- Partials      222      224       +2     

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

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