Only extract comic if it isn't already extracted (muuuuch faster for large comics)

This commit is contained in:
Junior 2026-02-16 14:34:42 -05:00
parent ee02a15182
commit 6460cfca37

View File

@ -47,11 +47,21 @@ if ( $row = $sth->fetch(PDO::FETCH_ASSOC) ) {
}
$data["startindex"] = $currentpage;
$extracted = false;
if ( !is_dir($comicoutputfull) ) {
mkdir($comicoutputfull, 0755, true);
} else {
touch($comicoutputfull);
$extracted = true;
}
$files = array();
if ( $extracted ) {
$contents = glob($comicoutputfull . "*");
foreach ( $contents as $i ) {
$files[] = basename($i);
}
} else {
if ( $ext == "cbz" ) {
$zip = new ZipArchive();
$opened = $zip->open($comicfull);
@ -83,6 +93,7 @@ if ( $ext == "cbz" ) {
} else {
exit();
}
}
natsort($files);