Skip to content

Commit

Permalink
Move cover art to ?coverart=1
Browse files Browse the repository at this point in the history
  • Loading branch information
fakerybakery authored and notartom committed Dec 14, 2024
1 parent f50f9f8 commit 740852f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
1 change: 1 addition & 0 deletions application/controllers/api/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public function audiobooks_get()

$params['since'] = $this->get('since');
$params['extended'] = $this->get('extended');
$params['coverart'] = $this->get('coverart');
//$params['simple'] = $this->get('simple');
$params['genre'] = $this->get('genre');
$params['title'] = $this->get('title');
Expand Down
13 changes: 9 additions & 4 deletions application/libraries/Librivox_API.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function _build_data_set($params)
//return $params;

$extended = (empty($params['extended'])) ? 0 : 1;
$show_cover_art = (empty($params['coverart'])) ? 0 : 1;

$limit = (!empty($params['limit'])) ? $params['limit'] : 50;
$offset = (!empty($params['offset'])) ? $params['offset'] : 0;
Expand Down Expand Up @@ -164,14 +165,18 @@ function _build_data_set($params)
// get authors
$project['authors'] = $this->_get_authors($row['id'], 'author');


if ($extended)
if ($show_cover_art)
{
$project['url_iarchive'] = $row['url_iarchive'];

$project['coverart_jpg'] = !empty($row['coverart_jpg']) ? $row['coverart_jpg'] : null;
$project['coverart_pdf'] = !empty($row['coverart_pdf']) ? $row['coverart_pdf'] : null;
$project['coverart_thumbnail'] = !empty($row['coverart_thumbnail']) ? $row['coverart_thumbnail'] : null;
}

if ($extended)
{
$project['url_iarchive'] = $row['url_iarchive'];



//get sections
$project['sections'] = $this->_get_sections($row['id']);
Expand Down
5 changes: 4 additions & 1 deletion application/views/public/temp_info/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<li>title - all matching titles</li>
<li>genre - all projects of the matching genre</li>
<li>extended - =1 will return the full set of data about the project</li>
<li>coverart - =1 will return links to cover art (if available) for each audiobook</li>
</ul>

</p>
Expand Down Expand Up @@ -135,10 +136,12 @@
<li>totaltime</li>
<li>totaltimesecs</li>
<li>authors</li>
<li>coverart_jpg</li>
<li>coverart_pdf</li>
<li>coverart_thumbnail</li>
<li>sections</li>
<li>genres</li>
<li>translators</li>

</ul>
</p>

Expand Down

0 comments on commit 740852f

Please sign in to comment.