Skip to content

Commit 740852f

Browse files
fakerybakerynotartom
authored andcommitted
Move cover art to ?coverart=1
1 parent f50f9f8 commit 740852f

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

application/controllers/api/Feed.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public function audiobooks_get()
2222

2323
$params['since'] = $this->get('since');
2424
$params['extended'] = $this->get('extended');
25+
$params['coverart'] = $this->get('coverart');
2526
//$params['simple'] = $this->get('simple');
2627
$params['genre'] = $this->get('genre');
2728
$params['title'] = $this->get('title');

application/libraries/Librivox_API.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ function _build_data_set($params)
7272
//return $params;
7373

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

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

167-
168-
if ($extended)
168+
if ($show_cover_art)
169169
{
170-
$project['url_iarchive'] = $row['url_iarchive'];
171-
172170
$project['coverart_jpg'] = !empty($row['coverart_jpg']) ? $row['coverart_jpg'] : null;
173171
$project['coverart_pdf'] = !empty($row['coverart_pdf']) ? $row['coverart_pdf'] : null;
174172
$project['coverart_thumbnail'] = !empty($row['coverart_thumbnail']) ? $row['coverart_thumbnail'] : null;
173+
}
174+
175+
if ($extended)
176+
{
177+
$project['url_iarchive'] = $row['url_iarchive'];
178+
179+
175180

176181
//get sections
177182
$project['sections'] = $this->_get_sections($row['id']);

application/views/public/temp_info/api.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
<li>title - all matching titles</li>
2020
<li>genre - all projects of the matching genre</li>
2121
<li>extended - =1 will return the full set of data about the project</li>
22+
<li>coverart - =1 will return links to cover art (if available) for each audiobook</li>
2223
</ul>
2324

2425
</p>
@@ -135,10 +136,12 @@
135136
<li>totaltime</li>
136137
<li>totaltimesecs</li>
137138
<li>authors</li>
139+
<li>coverart_jpg</li>
140+
<li>coverart_pdf</li>
141+
<li>coverart_thumbnail</li>
138142
<li>sections</li>
139143
<li>genres</li>
140144
<li>translators</li>
141-
142145
</ul>
143146
</p>
144147

0 commit comments

Comments
 (0)