fix(api) - #11 Send to Kindle Support

* fix(api/image_downloads): Replace image url with file path

* fix(api/image_downloads): Add comments

* fix(frontend): Update changelog

* Support Send2Kindle

* Update changelog
This commit is contained in:
Dhanush R
2024-11-03 04:52:30 +05:30
committed by GitHub
parent c0695a9d17
commit d9c858b3b3
2 changed files with 7 additions and 1 deletions
+6 -1
View File
@@ -149,8 +149,9 @@ async def fetch_cover(url: str, cookies: Optional[dict] = None) -> bytes:
def set_metadata(book, data): def set_metadata(book, data):
book.add_author(data["user"]["username"]) book.add_author(data["user"]["username"])
book.add_metadata("DC", "title", data["title"])
book.add_metadata("DC", "description", data["description"]) book.add_metadata("DC", "description", data["description"])
book.add_metadata("DC", "created", data["createDate"]) book.add_metadata("DC", "date", data["createDate"])
book.add_metadata("DC", "modified", data["modifyDate"]) book.add_metadata("DC", "modified", data["modifyDate"])
book.add_metadata("DC", "language", data["language"]["name"]) book.add_metadata("DC", "language", data["language"]["name"])
@@ -167,6 +168,10 @@ def set_metadata(book, data):
async def set_cover(book, data, cookies: Optional[dict] = None): async def set_cover(book, data, cookies: Optional[dict] = None):
book.set_cover("cover.jpg", await fetch_cover(data["cover"], cookies=cookies)) book.set_cover("cover.jpg", await fetch_cover(data["cover"], cookies=cookies))
chapter = epub.EpubHtml(
file_name=f"titlepage.xhtml", # Standard for cover page
)
chapter.set_content('<img src="cover.jpg">')
async def add_chapters( async def add_chapters(
+1
View File
@@ -68,6 +68,7 @@
</p> </p>
<ul class="pt-4 list list-inside text-xl"> <ul class="pt-4 list list-inside text-xl">
<!-- TODO: 'max-lg: hidden' to hide on screen sizes smaller than lg. I'll do this when I figure out how to make this show up _below_ the card on smaller screen sizes. --> <!-- TODO: 'max-lg: hidden' to hide on screen sizes smaller than lg. I'll do this when I figure out how to make this show up _below_ the card on smaller screen sizes. -->
<li>11/24 - 📨 Send to Kindle Support!</li>
<li>11/24 - ⚒️ Fix Image Downloads</li> <li>11/24 - ⚒️ Fix Image Downloads</li>
<li> <li>