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

shiori print command or API doesn't return the thumbnail url #838

Open
brunoamaral opened this issue Feb 7, 2024 · 1 comment
Open

shiori print command or API doesn't return the thumbnail url #838

brunoamaral opened this issue Feb 7, 2024 · 1 comment
Labels
type:bug Something isn't working

Comments

@brunoamaral
Copy link

Data

  • Shiori version: v1.6.0-rc.7
  • Database Engine: sqlite
  • Operating system: ubuntu
  • CLI/Web interface/Web Extension: CLI

Describe the bug / actual behavior

Maybe this is actually the expected behaviour, but running shiori print -j doesn't show a value for imageURL. It only returns ID, url, title, excerpt, public, modified, hasContent, tags, hasArchive, hasEbook, create_archive, and create_ebook.

Expected behavior

Any value for the imageUrl.

To Reproduce

shiori print -j or visit api/v1/bookmarks/

Screenshots

Notes

@brunoamaral brunoamaral added the type:bug Something isn't working label Feb 7, 2024
@github-project-automation github-project-automation bot moved this to To do in Roadmap Feb 7, 2024
@fmartingr
Copy link
Member

Investigation note: I checked this briefly today and the problem is that the old API filled the DTO model with all required field. We need to move this logic into the BookmarksDomain and use that from the API and the CLI.

fmartingr added a commit that referenced this issue 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](https://copilot-workspace.githubnext.com/go-shiori/shiori/issues/838?shareId=XXXX-XXXX-XXXX-XXXX).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
Status: To do
Development

Successfully merging a pull request may close this issue.

2 participants