Skip to content

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

@codecov
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
fmartingr and others added 5 commits December 8, 2024 16:45
- Resolved conflicts in go.mod/go.sum (used newer dependency versions)
- Resolved conflicts in database files (used new query builder patterns)
- Resolved conflicts in internal/cmd/add.go (used new dependency interface)
- Resolved conflicts in internal/core/ebook.go (used new ProcessRequest pattern)
- Resolved conflicts in internal/domains/archiver.go (simplified archiver logic)
- Resolved conflicts in internal/domains/bookmarks_test.go (used new dependency interface)
- Removed deleted route files (moved to new handler structure)
- Used master version of bookmark model and handler-api

Note: Some compilation issues remain due to architectural differences
between branches. These will be addressed in follow-up commits.
- Added missing Archiver and ArchivePath fields to BookmarkDTO
- Fixed database struct initialization (NewDBBase calls)
- Updated domain dependency access patterns (deps.Domains() calls)
- Fixed ProcessRequest usage in ebook generation
- Simplified webserver archiver calls (removed non-existent ProcessBookmarkArchive)
- Fixed archiver package dependency access patterns
- Added missing methods to ArchiverDomain interface and implementation
- Updated all dependency access to use new function-based interface

The feat/pdf-archiver branch now compiles successfully and is ready for testing.
- Convert EbookProcessRequest to ProcessRequest in ebook_test.go
- Fix DownloadBookmarkArchive -> GenerateBookmarkArchive method call in bookmark_test.go
- All go vet checks now pass
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

2 participants