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 == '')
|
if($path == '')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
try{
|
||||||
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $path) ?? '';
|
$ebookWwwFilesystemPath = preg_replace('|/content\.opf|ius', '', $path) ?? '';
|
||||||
|
|
||||||
$ebook = new Ebook($ebookWwwFilesystemPath);
|
$ebook = new Ebook($ebookWwwFilesystemPath);
|
||||||
|
|
||||||
$allEbooks[$ebook->ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;
|
$allEbooks[$ebook->ModifiedTimestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;
|
||||||
|
@ -37,6 +39,11 @@ foreach($contentFiles as $path){
|
||||||
// Sort this ebook by subject
|
// Sort this ebook by subject
|
||||||
$ebooksBySubject[$tag->Name][$ebook->Timestamp->format('Y-m-d\TH:i:s\Z') . ' ' . $ebook->Identifier] = $ebook;
|
$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
|
// Create the subjects navigation document
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue