Ensure images extract into volume folders
This commit is contained in:
@@ -31,10 +31,11 @@ export async function unzipManga(file: File) {
|
||||
if (imageTypes.includes(mime) || isMokuroFile) {
|
||||
const blob = await entry.getData?.(new BlobWriter(mime));
|
||||
if (blob) {
|
||||
const file = new File([blob], entry.filename, { type: mime });
|
||||
const fileName = entry.filename.split('/').pop() || entry.filename;
|
||||
const file = new File([blob], fileName, { type: mime });
|
||||
if (!file.webkitRelativePath) {
|
||||
Object.defineProperty(file, 'webkitRelativePath', {
|
||||
value: file.name
|
||||
value: entry.filename
|
||||
})
|
||||
}
|
||||
unzippedFiles[entry.filename] = file;
|
||||
|
||||
@@ -11,7 +11,7 @@ export async function zipManga(manga: Volume[]) {
|
||||
|
||||
const promises = manga.map((volume) => {
|
||||
const imagePromises = Object.values(volume.files).map((file) => {
|
||||
return zipWriter.add(file.name, new BlobReader(file))
|
||||
return zipWriter.add(`${volume.volumeName}/${file.name}`, new BlobReader(file))
|
||||
})
|
||||
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user