Only extract comic if it isn't already extracted (muuuuch faster for large comics)
This commit is contained in:
parent
ee02a15182
commit
6460cfca37
|
|
@ -47,11 +47,21 @@ if ( $row = $sth->fetch(PDO::FETCH_ASSOC) ) {
|
||||||
}
|
}
|
||||||
$data["startindex"] = $currentpage;
|
$data["startindex"] = $currentpage;
|
||||||
|
|
||||||
|
$extracted = false;
|
||||||
if ( !is_dir($comicoutputfull) ) {
|
if ( !is_dir($comicoutputfull) ) {
|
||||||
mkdir($comicoutputfull, 0755, true);
|
mkdir($comicoutputfull, 0755, true);
|
||||||
|
} else {
|
||||||
|
touch($comicoutputfull);
|
||||||
|
$extracted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
|
if ( $extracted ) {
|
||||||
|
$contents = glob($comicoutputfull . "*");
|
||||||
|
foreach ( $contents as $i ) {
|
||||||
|
$files[] = basename($i);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if ( $ext == "cbz" ) {
|
if ( $ext == "cbz" ) {
|
||||||
$zip = new ZipArchive();
|
$zip = new ZipArchive();
|
||||||
$opened = $zip->open($comicfull);
|
$opened = $zip->open($comicfull);
|
||||||
|
|
@ -83,6 +93,7 @@ if ( $ext == "cbz" ) {
|
||||||
} else {
|
} else {
|
||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
natsort($files);
|
natsort($files);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user