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) {
|
if (imageTypes.includes(mime) || isMokuroFile) {
|
||||||
const blob = await entry.getData?.(new BlobWriter(mime));
|
const blob = await entry.getData?.(new BlobWriter(mime));
|
||||||
if (blob) {
|
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) {
|
if (!file.webkitRelativePath) {
|
||||||
Object.defineProperty(file, 'webkitRelativePath', {
|
Object.defineProperty(file, 'webkitRelativePath', {
|
||||||
value: file.name
|
value: entry.filename
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
unzippedFiles[entry.filename] = file;
|
unzippedFiles[entry.filename] = file;
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export async function zipManga(manga: Volume[]) {
|
|||||||
|
|
||||||
const promises = manga.map((volume) => {
|
const promises = manga.map((volume) => {
|
||||||
const imagePromises = Object.values(volume.files).map((file) => {
|
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 [
|
return [
|
||||||
|
|||||||
Reference in New Issue
Block a user