mirror of
https://github.com/go-shiori/shiori.git
synced 2025-03-11 07:18:05 +08:00
feat: use bookmark thumbnail as ebook cover (#943)
* use thumbnail as ebook cover * add TODO for improve that later Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com> --------- Co-authored-by: Felipe Martin <812088+fmartingr@users.noreply.github.com>
This commit is contained in:
parent
06efb08d01
commit
a3d4a687aa
1 changed files with 6 additions and 0 deletions
|
@ -62,6 +62,12 @@ func GenerateEbook(deps *dependencies.Dependencies, req ProcessRequest, dstPath
|
|||
|
||||
ebook.SetTitle(book.Title)
|
||||
ebook.SetAuthor(book.Author)
|
||||
if deps.Domains.Storage.FileExists(bookmarkThumbnailPath) {
|
||||
// TODO: Use `deps.Domains.Storage` to retrieve the file.
|
||||
absoluteCoverPath := fp.Join(deps.Config.Storage.DataDir, bookmarkThumbnailPath)
|
||||
coverPath, _ := ebook.AddImage(absoluteCoverPath, "cover.jpg")
|
||||
ebook.SetCover(coverPath, "")
|
||||
}
|
||||
ebook.SetDescription(book.Excerpt)
|
||||
_, err = ebook.AddSection(`<h1 style="text-align:center"> `+book.Title+` </h1>`+book.HTML+lastline, book.Title, "", "")
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue