Add export_ad settings for export_zip task

This commit is contained in:
2023-06-22 23:01:33 +08:00
parent 1b4f9f39ad
commit 319adc7e93
3 changed files with 10 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ export type ExportZipConfig = {
output?: string;
jpn_title?: boolean;
max_length?: number;
export_ad?: boolean;
};
export const DEFAULT_EXPORT_ZIP_CONFIG: ExportZipConfig = {};
@@ -66,6 +67,12 @@ export async function export_zip(
db.get_pmeta(gid).sort((a, b) => a.index - b.index),
async (p) => {
const f = db.get_files(p.token);
const t = db.get_filemeta(p.token);
if (t && t.is_ad && !ecfg.export_ad) {
progress.total_page -= 1;
sendEvent();
return;
}
if (f.length) {
const r = await Deno.readFile(f[0].path, { signal });
await z.add(