hjyssg / ShiguReader

硬核宅宅资源管理器. Ultimate Manga Resource Manager
MIT License
395 stars 45 forks source link

解压文件包含重复文件名bug #201

Closed hjyssg closed 1 year ago

hjyssg commented 1 year ago

现在7zip是e,解压会互相overwrite

x可以解决。但是需要改

module.exports.extractAll
...
pathes = await pfs.readdir(outputPath);

还要改thumbnail现有代码

hjyssg commented 1 year ago
module.exports.extractAll = async function (filePath, outputPath) {
    if (!global._has_7zip_) {
        throw "this computer did not install 7z"
    }

    const opt = ['x', filePath, `-o${outputPath}`, "-aos"];
    // get7zipOption(filePath, outputPath);
    let error, pathes
    try {
        const { stderr } = await execa(sevenZip, opt);
        if (stderr) {
            throw stderr;
        }
        // pathes = await pfs.readdir(outputPath);
        const temp = await fileiterator(outputPath, {
            doNotNeedInfo: true,
            slient: true
        });
        pathes = temp.pathes;
    } catch (e) {
        error = e;
        logger.error('[extractAll] exit: ', e);
    } finally {
        return { error, pathes }
    }
}
      if(!config.slient){
                    if (config.estimated_total) {
                        console.log("[file-iterator] scan:", currentLen, `  ${(currentLen / config.estimated_total * 100).toFixed(2)}%`);
                    } else {
                        console.log("[file-iterator] scan:", currentLen);
                    }
                }
hjyssg commented 1 year ago

解压然后前端跳转按文件夹打开?

hjyssg commented 1 year ago

递归解压成完整结构

https://github.com/hjyssg/ShiguReader/pull/212