Skip to content

Commit

Permalink
List only images
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioMendolia committed Sep 20, 2023
1 parent 560cd9e commit 01a5b47
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Service/BookFileSystemManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,9 @@ public function extractCover(Book $book): Book

sort($entries);

$entries = array_values(array_filter($entries));
$entries = array_values(array_filter($entries, static function ($entry) {
return preg_match('/\.(jpg|jpeg|png|gif)$/i', $entry);
}));
if (count($entries) === 0) {
break;
}
Expand Down

0 comments on commit 01a5b47

Please sign in to comment.