Add Kindle thumbnails to AZW3 bulk downloads

This commit is contained in:
Alex Cabal 2023-04-19 12:06:36 -05:00
parent 9e4604df35
commit e28e8453b9

View file

@ -49,7 +49,13 @@ function CreateZip(string $filePath, array $ebooks, string $type, string $webRoo
if($type == 'azw3' && $ebook->Azw3Url !== null){ if($type == 'azw3' && $ebook->Azw3Url !== null){
$ebookFilePath = $webRoot . '/' . $ebook->Azw3Url; $ebookFilePath = $webRoot . '/' . $ebook->Azw3Url;
$zip->addFile($ebookFilePath, basename($ebookFilePath)); $folderName = basename($ebookFilePath, '.azw3');
$zip->addFile($ebookFilePath, $folderName . '/' . basename($ebookFilePath));
if($ebook->KindleCoverUrl !== null){
$ebookThumbnailPath = $webRoot . '/' . $ebook->KindleCoverUrl;
$zip->addFile($ebookFilePath, $folderName . '/' . basename($ebookThumbnailPath));
}
} }
if($type == 'kepub' && $ebook->KepubUrl !== null){ if($type == 'kepub' && $ebook->KepubUrl !== null){