mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-21 11:24:53 +02:00
Update book finder and cover matching - includes LibGen provider
This commit is contained in:
parent
be7e2576f1
commit
30700c1eb0
14 changed files with 379 additions and 76 deletions
|
@ -50,7 +50,7 @@ class OpenLibrary {
|
|||
return {
|
||||
title: doc.title,
|
||||
author: doc.author_name ? doc.author_name.join(', ') : null,
|
||||
first_publish_year: doc.first_publish_year,
|
||||
year: doc.first_publish_year,
|
||||
edition: doc.cover_edition_key,
|
||||
cover: doc.cover_edition_key ? `https://covers.openlibrary.org/b/OLID/${doc.cover_edition_key}-L.jpg` : null,
|
||||
...worksData
|
||||
|
@ -68,5 +68,17 @@ class OpenLibrary {
|
|||
var searchDocs = await Promise.all(lookupData.docs.map(d => this.cleanSearchDoc(d)))
|
||||
return searchDocs
|
||||
}
|
||||
|
||||
async searchTitle(title) {
|
||||
title = title.replace(/'/g, '')
|
||||
var lookupData = await this.get(`/search.json?title=${title}`)
|
||||
if (!lookupData) {
|
||||
return {
|
||||
errorCode: 404
|
||||
}
|
||||
}
|
||||
var searchDocs = await Promise.all(lookupData.docs.map(d => this.cleanSearchDoc(d)))
|
||||
return searchDocs
|
||||
}
|
||||
}
|
||||
module.exports = OpenLibrary
|
Loading…
Add table
Add a link
Reference in a new issue