Add export zip task

This commit is contained in:
2023-06-29 19:04:09 +08:00
parent 218412b110
commit 42cb28e38e
12 changed files with 226 additions and 21 deletions

View File

@@ -3,6 +3,10 @@ import { ConfigType } from "../config.ts";
import { get_ws_host } from "./utils.ts";
import { ConfigClientSocketData, ConfigSeverSocketData } from "./config.ts";
import { DEFAULT_DOWNLOAD_CONFIG, DownloadConfig } from "../tasks/download.ts";
import {
DEFAULT_EXPORT_ZIP_CONFIG,
ExportZipConfig,
} from "../tasks/export_zip.ts";
export const cfg = signal<ConfigType | undefined>(undefined);
@@ -36,3 +40,11 @@ export function generate_download_cfg(): DownloadConfig {
remove_previous_gallery: c.remove_previous_gallery,
};
}
export function generate_export_zip_cfg(): ExportZipConfig {
if (!cfg.value) return DEFAULT_EXPORT_ZIP_CONFIG;
const c = cfg.value;
return {
jpn_title: c.export_zip_jpn_title,
};
}

View File

@@ -8,3 +8,5 @@ export type GalleryData = {
};
export type GalleryResult = JSONResult<GalleryData>;
export type GalleryListResult = JSONResult<GMeta[]>;