From f94398cef82c8904da5fa121c74f3536f5c00f74 Mon Sep 17 00:00:00 2001 From: Daniel Bulant Date: Tue, 25 May 2021 15:44:10 +0200 Subject: [PATCH] multi downloads --- src/components/chapter.svelte | 54 +++++++ src/pages/[manga]/index.svelte | 229 +++++++++++++++++------------- src/util/baseGenerator.js | 73 ++++++++++ src/util/generateCbz.js | 52 +++++++ src/util/generateEpub.js | 252 ++++++++++++++++++--------------- src/util/report.js | 24 ++++ src/util/request.js | 3 +- 7 files changed, 479 insertions(+), 208 deletions(-) create mode 100644 src/components/chapter.svelte create mode 100644 src/util/baseGenerator.js create mode 100644 src/util/generateCbz.js create mode 100644 src/util/report.js diff --git a/src/components/chapter.svelte b/src/components/chapter.svelte new file mode 100644 index 0000000..3c1cf5d --- /dev/null +++ b/src/components/chapter.svelte @@ -0,0 +1,54 @@ + + + dispatch("select")} class:selected={selected}> + {chapter.data.attributes.volume ? "Vol " + chapter.data.attributes.volume : ""} + Chapter {chapter.data.attributes.chapter} + {chapter.data.attributes.title} + !disabledDownload && dispatch("download")} class:disabled={disabledDownload}>Download + !disabledDownload && dispatch("view")}>View + + + \ No newline at end of file diff --git a/src/pages/[manga]/index.svelte b/src/pages/[manga]/index.svelte index 3b373cf..d01312a 100644 --- a/src/pages/[manga]/index.svelte +++ b/src/pages/[manga]/index.svelte @@ -1,7 +1,8 @@ + + Chapters of {manga.title.en} @@ -128,6 +175,18 @@

+ {#if queue.length > 0} +

{queue.length} downloads queued.

+ {/if} + +
+ + +
+

Do not close the tab when a download is in progress. @@ -143,13 +202,7 @@ {#each chapters.results.filter(c => c.data.attributes.translatedLanguage === "en") as chapter} - - - - - - - + select(chapter)} on:download={() => downloadSingle(chapter)} /> {/each}
{chapter.data.attributes.volume ? "Vol " + chapter.data.attributes.volume : ""}Chapter {chapter.data.attributes.chapter}{chapter.data.attributes.title} prepare(chapter)}>DownloadView
@@ -157,6 +210,18 @@