From f782cad21325006552de1cd50d312f7c17918eba Mon Sep 17 00:00:00 2001 From: arabcoders Date: Thu, 10 Jul 2025 01:02:38 +0300 Subject: [PATCH] minor download form improvements. --- ui/@types/item.d.ts | 2 + ui/@types/responses.d.ts | 18 +++ ui/components/NewDownload.vue | 204 ++++++++++++++++++---------------- ui/utils/index.js | 21 ---- ui/utils/utils.ts | 24 ++++ 5 files changed, 151 insertions(+), 118 deletions(-) create mode 100644 ui/@types/responses.d.ts create mode 100644 ui/utils/utils.ts diff --git a/ui/@types/item.d.ts b/ui/@types/item.d.ts index 51abcfff..547d2666 100644 --- a/ui/@types/item.d.ts +++ b/ui/@types/item.d.ts @@ -1,4 +1,6 @@ export type item_request = { + /** Unique identifier for the item */ + id?: string|null, /** URL of the item to download */ url: string, /** Preset to use for the download */ diff --git a/ui/@types/responses.d.ts b/ui/@types/responses.d.ts new file mode 100644 index 00000000..377ed414 --- /dev/null +++ b/ui/@types/responses.d.ts @@ -0,0 +1,18 @@ +export type error_response = { + /** The error message */ + error: string, +} + +export type convert_args_response = { + /** The converted CLI args */ + opts?: Record, + /** The output template if was provided */ + output_template?: string, + /** The download path if was provided */ + download_path?: string, + /** The download format if was provided */ + format?: string, + /** The removed options from the original CLI args if any. */ + removed_options?: string[], +} + diff --git a/ui/components/NewDownload.vue b/ui/components/NewDownload.vue index 6a2ae274..5238feba 100644 --- a/ui/components/NewDownload.vue +++ b/ui/components/NewDownload.vue @@ -7,33 +7,31 @@
-
-
- - +
+
- - - You can add multiple URLs separated by {{ getSeparatorsName(separator) }}. -
+
-
- +
@@ -55,13 +53,14 @@
+
-
- + +
+ +
+
+
+ v-if="show_description && !config.app.basic_mode && !hasFormatInConfig && get_preset(form.preset)?.description">
{{ get_preset(form.preset)?.description }} @@ -96,12 +96,14 @@
-
- +
+ +
+
- - - Use this to separate multiple URLs in the input field. -
+ + + Use this to separate multiple URLs in the input field. +
-
- +
+ +
+
- - - All output template naming options can be found at this page. -
+ + + All output template naming options can be found at this page. +
@@ -154,7 +158,7 @@ Check this page for more info. Not all options are supported some are + to="https://github.com/arabcoders/ytptube/blob/master/app/library/Utils.py#L26-L48">some are ignored. Use with caution these options can break yt-dlp or the frontend. @@ -222,7 +226,7 @@
@@ -237,22 +241,23 @@ + -