Merge pull request #4873 from Vito0912/feat/fixUploadLookup

Fix Upload Lookup
This commit is contained in:
advplyr 2025-11-29 16:26:26 -06:00 committed by GitHub
commit 0606738b38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 3 deletions

View file

@ -88,10 +88,10 @@ class SearchController {
const provider = getQueryParamAsString(query, 'provider', 'google')
const title = getQueryParamAsString(query, 'title', '')
const author = getQueryParamAsString(query, 'author', '')
const id = getQueryParamAsString(query, 'id', '', true)
const id = getQueryParamAsString(query, 'id', undefined)
// Fetch library item
const libraryItem = await SearchController.fetchLibraryItem(id)
const libraryItem = id ? await SearchController.fetchLibraryItem(id) : null
const results = await BookFinder.search(libraryItem, provider, title, author)
res.json(results)

View file

@ -428,7 +428,7 @@ class BookFinder {
}
}
if (books.length) {
if (books.length && libraryItem) {
const isAudibleProvider = provider.startsWith('audible')
const libraryItemDurationMinutes = libraryItem?.media?.duration ? libraryItem.media.duration / 60 : null