Skip to content

Commit

Permalink
fix xml engine
Browse files Browse the repository at this point in the history
  • Loading branch information
ewilan-riviere committed Sep 23, 2023
1 parent 552b217 commit 88961ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Engine/OpdsXmlEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,10 @@ public function addBookEntry(OpdsEntryBook $entry): array
$categories[] = $this->addXmlNode(attributes: ['term' => $item, 'label' => $item]);
}

foreach ($entry->getAuthors() as $item) {
$authors[] = ['name' => $item->getName(), 'uri' => $item->getUri()];
if ($entry->getAuthors()) {
foreach ($entry->getAuthors() as $item) {
$authors[] = ['name' => $item->getName(), 'uri' => $item->getUri()];
}
}

$media = $entry->getMedia();
Expand Down

0 comments on commit 88961ad

Please sign in to comment.