diff --git a/web/src/lib/components/download-dialogs/download-dialog-wrapper.svelte b/web/src/lib/components/download-dialogs/download-dialog-wrapper.svelte new file mode 100644 index 0000000..ff37b35 --- /dev/null +++ b/web/src/lib/components/download-dialogs/download-dialog-wrapper.svelte @@ -0,0 +1,32 @@ + + + + {triggerText} + + + {title} + + {description} + + + {@render children()} + + diff --git a/web/src/lib/components/download-dialogs/download-movie-dialog.svelte b/web/src/lib/components/download-dialogs/download-movie-dialog.svelte index f62da2d..749c5f6 100644 --- a/web/src/lib/components/download-dialogs/download-movie-dialog.svelte +++ b/web/src/lib/components/download-dialogs/download-movie-dialog.svelte @@ -1,19 +1,18 @@ - - Download Movie - - - Download a Movie - - Search and download torrents for a specific season or season packs. - - - - - Standard Mode - Advanced Mode - - -
- -
-
- -
- -
- - -
-

- The custom query will override the default search string like "A Minecraft Movie - (2025)". -

-
-
-
- {#if torrentsError} -
An error occurred: {torrentsError}
- {/if} -
- {#await torrentsPromise} -
- -

Loading torrents...

-
- {:then} -

Found Torrents:

-
- - - - Title - {#each tableColumnHeadings as { name, id } (id)} - sortData(id)} class="cursor-pointer"> -
- {name} - {#if getSortedColumnState(id) === true} - - {:else if getSortedColumnState(id) === false} - - {:else} - - - {/if} -
-
- {/each} - Actions -
-
- - {#each torrentsData as torrent (torrent.id)} - - {torrent.title} - {(torrent.size / 1024 / 1024 / 1024).toFixed(2)}GB - {torrent.seeders} - {torrent.score} - {torrent.indexer ?? 'Unknown'} - - {#each torrent.flags as flag (flag)} - {flag} - {/each} - - - downloadTorrent(torrent.id!)} - /> - - - {:else} - {#if torrentsData === null} - -
- Start searching by clicking the search button! -
-
- {:else} - -
No torrents found.
-
- {/if} - {/each} -
-
-
- {:catch error} -
Failed to load torrents.
-
Error: {error.message}
- {/await} -
-
-
+ + + {#snippet basicModeContent()} + + {/snippet} + + {#if torrentsError} +
An error occurred: {torrentsError}
+ {/if} + + {#snippet rowSnippet(torrent)} + {torrent.title} + {(torrent.size / 1024 / 1024 / 1024).toFixed(2)}GB + {torrent.seeders} + {torrent.score} + {torrent.indexer ?? 'Unknown'} + + {#each torrent.flags as flag (flag)} + {flag} + {/each} + + + downloadTorrent(torrent.id)} + /> + + {/snippet} + +
diff --git a/web/src/lib/components/download-dialogs/download-season-dialog.svelte b/web/src/lib/components/download-dialogs/download-season-dialog.svelte index b9171ab..65bfc80 100644 --- a/web/src/lib/components/download-dialogs/download-season-dialog.svelte +++ b/web/src/lib/components/download-dialogs/download-season-dialog.svelte @@ -1,5 +1,5 @@ - - Download Seasons - - - Download a Season - - Search and download torrents for a specific season or season packs. - - - - - Standard Mode - Advanced Mode - - -
- -
- - -
-

- Enter the season's number you want to search for. The first, usually 1, or the last - season number usually yield the most season packs. Note that only Seasons which are - listed in the "Seasons" cell will be imported! -

-
-
- -
- -
- - -
-

- The custom query will override the default search string like "The Simpsons Season 3". - Note that only Seasons which are listed in the "Seasons" cell will be imported! -

-
-
-
- {#if torrentsError} -
An error occurred: {torrentsError}
- {/if} -
- {#await torrentsPromise} -
- -

Loading torrents...

-
- {:then} -

Found Torrents:

-
- - - - Title - {#each tableColumnHeadings as { name, id } (id)} - sortData(id)} class="cursor-pointer"> -
- {name} - {#if getSortedColumnState(id) === true} - - {:else if getSortedColumnState(id) === false} - - {:else} - - - {/if} -
-
- {/each} - Actions -
-
- - {#each torrentsData as torrent (torrent.id)} - - {torrent.title} - {(torrent.size / 1024 / 1024 / 1024).toFixed(2)}GB - {torrent.usenet} - {torrent.usenet ? 'N/A' : torrent.seeders} - {torrent.age - ? formatSecondsToOptimalUnit(torrent.age) - : torrent.usenet - ? 'N/A' - : ''} - {torrent.score} - {torrent.indexer ?? 'unknown'} - - {#if torrent.flags} - {#each torrent.flags as flag (flag)} - {flag} - {/each} - {/if} - - - {#if torrent.season} - {convertTorrentSeasonRangeToIntegerRange(torrent.season)} - {/if} - - - downloadTorrent(torrent.id!)} - /> - - - {:else} - {#if torrentsData === null} - -
- Start searching by clicking the search button! -
-
- {:else} - -
No torrents found.
-
- {/if} - {/each} -
-
-
- {:catch error} -
Failed to load torrents.
-
Error: {error.message}
- {/await} -
-
-
+ + + {#snippet basicModeContent()} + +
+ + +
+

+ Enter the season's number you want to search for. The first, usually 1, or the last season + number usually yield the most season packs. Note that only Seasons which are listed in the + "Seasons" cell will be imported! +

+ {/snippet} +
+ {#if torrentsError} +
An error occurred: {torrentsError}
+ {/if} + + {#snippet rowSnippet(torrent)} + {torrent.title} + {(torrent.size / 1024 / 1024 / 1024).toFixed(2)}GB + {torrent.usenet} + {torrent.usenet ? 'N/A' : torrent.seeders} + {torrent.age + ? formatSecondsToOptimalUnit(torrent.age) + : torrent.usenet + ? 'N/A' + : ''} + {torrent.score} + {torrent.indexer ?? 'unknown'} + + {#if torrent.flags} + {#each torrent.flags as flag (flag)} + {flag} + {/each} + {/if} + + + {#if torrent.season} + {convertTorrentSeasonRangeToIntegerRange(torrent.season)} + {/if} + + + downloadTorrent(torrent.id)} + /> + + {/snippet} + +
diff --git a/web/src/lib/components/download-dialogs/search-tabs.svelte b/web/src/lib/components/download-dialogs/search-tabs.svelte new file mode 100644 index 0000000..faaa510 --- /dev/null +++ b/web/src/lib/components/download-dialogs/search-tabs.svelte @@ -0,0 +1,47 @@ + + + + + Standard Mode + Advanced Mode + + +
+ {@render basicModeContent()} +
+
+ +
+ +
+ + +
+

+ {advancedModeHelpText} +

+
+
+
diff --git a/web/src/lib/components/download-dialogs/torrent-table.svelte b/web/src/lib/components/download-dialogs/torrent-table.svelte new file mode 100644 index 0000000..a12b38f --- /dev/null +++ b/web/src/lib/components/download-dialogs/torrent-table.svelte @@ -0,0 +1,101 @@ + + +
+ {#await torrentsPromise} +
+ +

Loading torrents...

+
+ {:then data} +

Found Torrents:

+
+ + + + Title + {#each columns as column (column.id)} + toggleSort(column.id)} class="cursor-pointer"> +
+ {column.name} + {#if getSortedColumnState(column.id) === true} + + {:else if getSortedColumnState(column.id) === false} + + {:else} + + + {/if} +
+
+ {/each} + Actions +
+
+ + {#if data} + {@const sortedData = sort(data, sortBy.col, sortBy.ascending)} + {#each sortedData as torrent (torrent.id)} + + {@render rowSnippet(torrent)} + + {:else} + +
No torrents found.
+
+ {/each} + {:else} + +
+ Start searching by clicking the search button! +
+
+ {/if} +
+
+
+ {:catch error} +
Failed to load torrents.
+
Error: {error.message}
+ {/await} +