diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index b35d437..c0bd5de 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -395,11 +395,19 @@ class NetBiblio extends WebService } $s->addSortField('availabilityDate'); - $results = $s->getResults(0, $itemsByGroup); + try { + $results = $s->getResults(0, $itemsByGroup); + } catch(SolrClientException $e) { + throw new WebException ("SolrError", $e->getMessage(), -710); + } $ids = array_map(function($r) { return $r['id']; }, $results['response']['docs']); $books = AudioBook::findBy('NoticeID', $ids, true); - $this->data = array_map(array($this, 'AddFiles'), $books); + $books = array_map(array($this, 'AddFiles'), $books); + + foreach($books as $b) { + $this->data[$b['type']][] = $b; + } } protected function Output()