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

fix: add thumbnail URL in print command #1031

Closed
wants to merge 3 commits into from

Conversation

fmartingr
Copy link
Member

@fmartingr fmartingr commented Dec 17, 2024

Fixes #838

Add imageURL field to shiori print -j command and api/v1/bookmarks/ endpoint

  • BookmarksDomain: Add populateImageURL method to set ImageURL field. Update GetBookmark method to call populateImageURL method.
  • BookmarksDomain Tests: Add test for populateImageURL method in TestBookmarkDomain function.
  • API: Update getBookmark method in internal/http/routes/api/v1/bookmarks.go to include ImageURL field in response.
  • API Tests: Add test for ImageURL field in TestReadableeBookmarkContent function.
  • CLI: Update printHandler function in internal/cmd/print.go to get the bookmarks using the BookmarksDomain present in deps instead of deps.Database. Remove the loop that calls populateImageUrl.

For more details, open the Copilot Workspace session.

Fixes #838

Add `imageURL` field to `shiori print -j` command and `api/v1/bookmarks/` endpoint

* **BookmarksDomain**: Add `populateImageURL` method to set `ImageURL` field. Update `GetBookmark` method to call `populateImageURL` method.
* **BookmarksDomain Tests**: Add test for `populateImageURL` method in `TestBookmarkDomain` function.
* **API**: Update `getBookmark` method in `internal/http/routes/api/v1/bookmarks.go` to include `ImageURL` field in response.
* **API Tests**: Add test for `ImageURL` field in `TestReadableeBookmarkContent` function.
* **CLI**: Update `printHandler` function in `internal/cmd/print.go` to get the bookmarks using the `BookmarksDomain` present in `deps` instead of `deps.Database`. Remove the loop that calls `populateImageUrl`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/go-shiori/shiori/issues/838?shareId=XXXX-XXXX-XXXX-XXXX).
* Add `TestImageURLField` subtest to verify `ImageURL` field is populated correctly
* Add two test cases: one for when `ImageURL` is populated and one for when it is empty
@fmartingr fmartingr closed this Dec 21, 2024
@fmartingr fmartingr deleted the fmartingr/fix/print-thumbnail-url branch December 21, 2024 06:49
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.

shiori print command or API doesn't return the thumbnail url
1 participant