Skip to content

Commit

Permalink
provide kepub without update of opf properties - see issue #71
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespub committed Feb 15, 2024
1 parent 2895552 commit 4af3f32
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
// absolute path for single DB in PHP app here - cfr. internal dir for X-Accel-Redirect with Nginx
$file = $book->getFilePath($type, $idData);
if (!$viewOnly && $type == 'epub' && Config::get('update_epub-metadata')) {
// update epub metadata + provide kepub if needed (with update of opf properties for cover-image in EPub)
if (Config::get('provide_kepub') == '1' && preg_match('/Kobo/', $request->agent())) {
$book->updateForKepub = true;
}
Expand All @@ -86,6 +87,9 @@
}
if ($viewOnly) {
header('Content-Disposition: inline');
} elseif (Config::get('provide_kepub') == '1' && preg_match('/Kobo/', $request->agent())) {
// provide kepub if needed (without update of opf properties for cover-image in Epub)
header('Content-Disposition: attachment; filename="' . basename($data->getUpdatedFilenameKepub()) . '"');
} else {
header('Content-Disposition: attachment; filename="' . basename($file) . '"');
}
Expand Down

0 comments on commit 4af3f32

Please sign in to comment.