Skip to content

Commit

Permalink
API search with serie
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 10, 2023
1 parent c963376 commit ccc0045
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Service/BookSuggestions.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public function getSuggestions(Book $book): array

$cache = new FilesystemAdapter();

$query = 'intitle:"'.$book->getTitle().'" inauthor:'.implode(' ', $book->getAuthors());
$query = 'intitle:"'.$book->getSerie().' '.$book->getSerieIndex().' '.$book->getTitle().'" inauthor:'.implode(' ', $book->getAuthors());

$cacheKey = $this->slugger->slug($query);

Expand All @@ -58,7 +58,7 @@ public function getSuggestions(Book $book): array
$results = $service->volumes->listVolumes($query, $optParams);

if (0 === $results->getTotalItems()) {
$query = 'intitle:"'.$book->getTitle().'"';
$query = 'intitle:"'.$book->getSerie().' '.$book->getSerieIndex().' '.$book->getTitle().'"';
$results = $service->volumes->listVolumes($query, $optParams);
}

Expand Down

0 comments on commit ccc0045

Please sign in to comment.