Compare commits

..

3 Commits

Author SHA1 Message Date
4c1789fc16 fix: doc parsing
All checks were successful
continuous-integration/drone Build is passing
2026-01-24 13:33:09 -05:00
082f7e926c fix: fix annas archive url 2026-01-24 13:33:01 -05:00
6031cf06d4 chore: update nix flake 2026-01-24 13:25:52 -05:00
3 changed files with 5 additions and 5 deletions

View File

@@ -1317,7 +1317,7 @@ class EBookReader {
let spineWC = await Promise.all( let spineWC = await Promise.all(
this.book.spine.spineItems.map(async (item) => { this.book.spine.spineItems.map(async (item) => {
let newDoc = await item.load(this.book.load.bind(this.book)); let newDoc = await item.load(this.book.load.bind(this.book));
let spineWords = newDoc.innerText.trim().split(/\s+/).length; let spineWords = (newDoc.innerText || "").trim().split(/\s+/).length;
item.wordCount = spineWords; item.wordCount = spineWords;
return spineWords; return spineWords;
}), }),

6
flake.lock generated
View File

@@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1764522689, "lastModified": 1769089682,
"narHash": "sha256-SqUuBFjhl/kpDiVaKLQBoD8TLD+/cTUzzgVFoaHrkqY=", "narHash": "sha256-9yA/LIuAVQq0lXelrZPjLuLVuZdm03p8tfmHhnDIkms=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "8bb5646e0bed5dbd3ab08c7a7cc15b75ab4e1d0f", "rev": "078d69f03934859a181e81ba987c2bb033eebfc5",
"type": "github" "type": "github"
}, },
"original": { "original": {

View File

@@ -10,7 +10,7 @@ import (
) )
func searchAnnasArchive(query string) ([]SearchItem, error) { func searchAnnasArchive(query string) ([]SearchItem, error) {
searchURL := "https://annas-archive.org/search?index=&q=%s&ext=epub&sort=&lang=en" searchURL := "https://annas-archive.li/search?index=&q=%s&ext=epub&sort=&lang=en"
url := fmt.Sprintf(searchURL, url.QueryEscape(query)) url := fmt.Sprintf(searchURL, url.QueryEscape(query))
body, err := getPage(url) body, err := getPage(url)
if err != nil { if err != nil {