diff --git a/config.example.jsonc b/config.example.jsonc index 1e3bfa2..708c1db 100644 --- a/config.example.jsonc +++ b/config.example.jsonc @@ -13,5 +13,6 @@ "db_path": "./downloads", "max_retry_count": 3, "max_download_img_count": 3, - "download_original_img": true + "download_original_img": true, + "port": 8000 } diff --git a/config.ts b/config.ts index 63c7aac..82a9951 100644 --- a/config.ts +++ b/config.ts @@ -12,6 +12,7 @@ export type ConfigType = { max_retry_count: number; max_download_img_count: number; download_original_img: boolean; + port: number; }; export class Config { @@ -85,6 +86,9 @@ export class Config { get download_original_img() { return this._return_bool("download_original_img") || false; } + get port() { + return this._return_number("port") || 8000; + } to_json(): ConfigType { return { cookies: typeof this.cookies === "string", @@ -97,6 +101,7 @@ export class Config { max_retry_count: this.max_retry_count, max_download_img_count: this.max_download_img_count, download_original_img: this.download_original_img, + port: this.port, }; } } diff --git a/islands/Settings.tsx b/islands/Settings.tsx index 0f4f060..85e9011 100644 --- a/islands/Settings.tsx +++ b/islands/Settings.tsx @@ -178,6 +178,14 @@ export default class Settings extends Component { description={t("settings.db_path")} helpertext={t("settings.db_path_help")} /> +