diff --git a/application/controllers/api/Feed.php b/application/controllers/api/Feed.php index d77d7e5b..5ae4e884 100644 --- a/application/controllers/api/Feed.php +++ b/application/controllers/api/Feed.php @@ -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'); diff --git a/application/libraries/Librivox_API.php b/application/libraries/Librivox_API.php index 1077ace7..c30a9449 100644 --- a/application/libraries/Librivox_API.php +++ b/application/libraries/Librivox_API.php @@ -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; @@ -164,11 +165,19 @@ function _build_data_set($params) // get authors $project['authors'] = $this->_get_authors($row['id'], 'author'); + if ($show_cover_art) + { + $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']); diff --git a/application/views/public/temp_info/api.php b/application/views/public/temp_info/api.php index 0500c6b9..dadea608 100644 --- a/application/views/public/temp_info/api.php +++ b/application/views/public/temp_info/api.php @@ -19,6 +19,7 @@
  • title - all matching titles
  • genre - all projects of the matching genre
  • extended - =1 will return the full set of data about the project
  • +
  • coverart - =1 will return links to cover art (if available) for each audiobook
  • @@ -135,10 +136,12 @@
  • totaltime
  • totaltimesecs
  • authors
  • +
  • coverart_jpg
  • +
  • coverart_pdf
  • +
  • coverart_thumbnail
  • sections
  • genres
  • translators
  • -