mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2024-12-20 19:06:06 +01:00
Merge branch 'master' of https://github.com/advplyr/audiobookshelf
This commit is contained in:
commit
f2b970f812
@ -6,9 +6,9 @@ class Audible {
|
||||
constructor() { }
|
||||
|
||||
cleanResult(item) {
|
||||
var { title, subtitle, asin, authors, narrators, publisher_name, publisher_summary, release_date, series, product_images } = item;
|
||||
var { title, subtitle, asin, authors, narrators, publisher_name, publisher_summary, release_date, series, product_images, publication_name } = item;
|
||||
|
||||
var firstSeries = series && series.length > 0 ? series[0] : null;
|
||||
var primarySeries = this.getPrimarySeries(series, publication_name);
|
||||
|
||||
return {
|
||||
title,
|
||||
@ -20,8 +20,8 @@ class Audible {
|
||||
description: stripHtml(publisher_summary).result,
|
||||
cover: this.getBestImageLink(product_images),
|
||||
asin,
|
||||
series: firstSeries ? firstSeries.title : null,
|
||||
volumeNumber: firstSeries ? firstSeries.sequence : null
|
||||
series: primarySeries ? primarySeries.title : null,
|
||||
volumeNumber: primarySeries ? primarySeries.sequence : null
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,6 +30,10 @@ class Audible {
|
||||
return images[keys[keys.length - 1]];
|
||||
}
|
||||
|
||||
getPrimarySeries(series, publication_name) {
|
||||
return (series && series.length > 0) ? series.find((s) => s.title == publication_name) || series[0] : null
|
||||
}
|
||||
|
||||
async search(title, author) {
|
||||
var queryString = `response_groups=rating,series,contributors,product_desc,media,product_extended_attrs` +
|
||||
`&image_sizes=500,1024,2000&num_results=25&products_sort_by=Relevance&title=${title}`;
|
||||
|
Loading…
Reference in New Issue
Block a user