mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
Continue processing more OPDS entries if one ebook can't be parsed
This commit is contained in:
parent
73ba658a05
commit
1d56a06c79
1 changed files with 18 additions and 11 deletions
|
@ -22,7 +22,9 @@ foreach($contentFiles as $path){
|
|||
if($path == '')
|
||||
continue;
|
||||
|
||||
try{
|
||||
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $path) ?? '';
|
||||
|
||||
$ebook = new Ebook($ebookWwwFilesystemPath);
|
||||
|
||||
$allEbooks[$ebook->ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;
|
||||
|
@ -38,6 +40,11 @@ foreach($contentFiles as $path){
|
|||
$ebooksBySubject[$tag->Name][$ebook->Timestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;
|
||||
}
|
||||
}
|
||||
catch(\Exception $ex){
|
||||
print('Failed to generate OPDS entry for `' . $ebookWwwFilesystemPath . '`. Exception: ' . $ex->getMessage());
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Create the subjects navigation document
|
||||
sort($subjects);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue