From a0cbe5415226ac444d7cce5d709310a9a111314b Mon Sep 17 00:00:00 2001 From: Cucumberrbob <128094686+Cucumberrbob@users.noreply.github.com> Date: Sun, 18 May 2025 15:46:54 +0100 Subject: [PATCH 1/2] migrate to new Angular Control Flow syntax also fixes a typo --- .../add-new-torrent.component.html | 40 +- client/src/app/login/login.component.html | 8 +- client/src/app/navbar/navbar.component.html | 52 +- client/src/app/profile/profile.component.html | 8 +- .../src/app/settings/settings.component.html | 365 ++++---- client/src/app/setup/setup.component.html | 270 +++--- .../torrent-table.component.html | 139 ++-- .../torrent-table/torrent-table.component.ts | 4 - client/src/app/torrent/torrent.component.html | 777 ++++++++++-------- 9 files changed, 903 insertions(+), 760 deletions(-) diff --git a/client/src/app/add-new-torrent/add-new-torrent.component.html b/client/src/app/add-new-torrent/add-new-torrent.component.html index 585b2f7..1e82e1b 100644 --- a/client/src/app/add-new-torrent/add-new-torrent.component.html +++ b/client/src/app/add-new-torrent/add-new-torrent.component.html @@ -84,11 +84,15 @@ -
- When downloading with AllDebrid it cannot be guaranteed that only files above this limit will be download as - some files are grouped together in 1 large archive. -
-This setting does not apply to manually selected files.
+ @if (provider === "AllDebrid") { ++ When downloading with AllDebrid it cannot be guaranteed that only files above this limit will be download as + some files are grouped together in 1 large archive. +
+ } + @if (downloadAction === 2) { +This setting does not apply to manually selected files.
+ }This setting does not apply to manually selected files.
-{{ includeRegexError }}
+ @if (downloadAction === 2) { +This setting does not apply to manually selected files.
+ } + @if (includeRegexError) { +{{ includeRegexError }}
+ }This setting does not apply to manually selected files.
-{{ excludeRegexError }}
+ @if (downloadAction === 2) { +This setting does not apply to manually selected files.
+ } + @if (excludeRegexError) { +{{ excludeRegexError }}
+ }- @if (canRegisterMagnetHandler) { - This will attempt to register the client as your browser's default handler for magnet links and automatically open - them in the new torrent screen for downloading. - } @else { - Magnet link registration is unavailable. Your - - browser may not support this feature - - , or the client is not being served in a - - secure context - - . + @if (error?.length > 0) { +
+ @if (canRegisterMagnetHandler) { + This will attempt to register the client as your browser's default handler for magnet links and automatically + open them in the new torrent screen for downloading. + } @else { + Magnet link registration is unavailable. Your + + browser may not support this feature + + , or the client is not being served in a + + secure context + + . + } +
+
- | ID | -Path | -Size | -Selected | -
|---|---|---|---|
| - {{ file.id }} - | -- {{ file.path }} - | -- {{ file.bytes | filesize }} - | -- - - | -
| - | Link | -Size | -Status | -||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - - - | -
- |
- - {{ download.bytesTotal | filesize }} - | -- {{ download | downloadStatus }} - | -||||||||||||||||||
| - |
-
-
-
-
-
-
-
-
-
- {{ download.error }}
-
-
-
-
+} @else {
+
+ @if (activeTab === 0) {
+
+
+ }
+ @if (activeTab === 1) {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ torrent | status }}
+
+
+
+ {{ torrent.retryCount }} / {{ torrent.torrentRetryAttempts }}
+
+
+
+ {{ torrent.hash }}
+
+
+
+ {{ torrent.priority || "" }}
+
+
+
+ {{ torrent.category || "(no category set)" }}
+
+
+
+ @switch (torrent.downloadClient) {
+ @case (0) {
+ Internal Downloader
+ }
+ @case (1) {
+ Bezadd
+ }
+ @case (2) {
+ Aria2c
+ }
+ @case (3) {
+ Symlink Downloader
+ }
+ @case (4) {
+ Synology DownloadStation
+ }
+ }
+
+
+
+ @switch (torrent.hostDownloadAction) {
+ @case (0) {
+ Download all files to host
+ }
+ @case (1) {
+ Don't download files to host
+ }
+ }
+
+
+
+ @switch (torrent.downloadAction) {
+ @case (0) {
+ Download all files above a certain size
+ }
+ @case (1) {
+ Download all available files on Real-Debrid above a certain size
+ }
+ @case (2) {
+ Pick files I want to download
+ }
+ }
+
+
+
+ @switch (torrent.finishedAction) {
+ @case (0) {
+ Do nothing
+ }
+ @case (1) {
+ Remove torrent from Real-Debrid and Real-Debrid Client
+ }
+ @case (2) {
+ Remove torrent from Real-Debrid
+ }
+ @case (3) {
+ Remove torrent from client
+ }
+ }
+
+
+
+ {{ torrent.downloadMinSize }}MB
+
+
+
+ {{ torrent.includeRegex }}
+
+
+
+ {{ torrent.excludeRegex }}
+
+ @if (!torrent.isFile) {
+
+
+ @if (!copied) {
+
+ Click to copy magnet link to clipboard
+
+ } @else {
+ Link copied to clipboard!
+ }
+
+ } @else {
+
+
+ Click to download torrent file
+
+ }
+
+
+ {{ torrent.added | date: "fullDate" }} {{ torrent.added | date: "mediumTime" }}
+
+
+
+ @if (torrent.filesSelected === null) {
+ (no files selected yet)
+ } @else {
+ {{ torrent.filesSelected | date: "fullDate" }} {{ torrent.filesSelected | date: "mediumTime" }}
+ }
+
+
+
+ @if (torrent.completed === null) {
+ (not completed yet)
+ } @else {
+ {{ torrent.completed | date: "fullDate" }} {{ torrent.completed | date: "mediumTime" }}
+ }
+
+
+
+
+
+ {{ torrent.rdId }}
+
+
+
+ {{ torrent.rdName }}
+
+
+
+ {{ torrent.rdSize | filesize }}
+
+
+
+ {{ torrent.rdHost }}
+
+
+
+ {{ torrent.rdSplit }}
+
+
+
+ {{ torrent.rdProgress || 0 }}%
+
+
+
+ @switch (torrent.rdStatus) {
+ @case (0) {
+ Processing
+ }
+ @case (1) {
+ Waiting For File Selection
+ }
+ @case (2) {
+ Downloading
+ }
+ @case (3) {
+ Finished
+ }
+ @case (99) {
+ Error
+ }
+ }
+ ({{ torrent.rdStatusRaw }})
+
+
+
+ {{ torrent.rdAdded | date: "fullDate" }} {{ torrent.rdAdded | date: "mediumTime" }}
+
+
+
+ {{ torrent.rdEnded | date: "fullDate" }} {{ torrent.rdEnded | date: "mediumTime" }}
+
+
+
+ {{ torrent.rdSpeed || 0 }}
+
+
+
+ {{ torrent.rdSeeders || "0" }}
+
+
+
+ }
+ @if (activeTab === 2) {
+
+
+
+
+
+ }
+
|
+ + {{ download.bytesTotal | filesize }} + | ++ {{ download | downloadStatus }} + | +||||||||||||||||||
| + |
+
+
+
+
+
+
+ @if (download.error) {
+
+
+
+
+
+ {{ download.error }}
+
+ }
+
+
+ @if (download.link) {
+ {{ download.link | decodeURI }}
+ }
+
+
+
+ {{ download.path }}
+
+
+
+ {{ download.bytesDone | filesize }} / {{ download.bytesTotal | filesize }} ({{
+ download.speed | filesize
+ }}/s)
+
+
+
+ {{ download.retryCount }} / {{ torrent.downloadRetryAttempts }}
+
+
+
+
+
+ @if (download.added) {
+ {{ download.added | date: "fullDate" }} {{ download.added | date: "mediumTime" }}
+ } @else {
+ (not added yet)
+ }
+
+
+
+ @if (download.downloadQueued) {
+ {{ download.downloadQueued | date: "fullDate" }}
+ {{ download.downloadQueued | date: "mediumTime" }}
+ } @else {
+ (not queued for downloading yet)
+ }
+
+
+
+ @if (download.downloadStarted) {
+ {{ download.downloadStarted | date: "fullDate" }}
+ {{ download.downloadStarted | date: "mediumTime" }}
+ } @else {
+ (not started downloading yet)
+ }
+
+
+
+ @if (download.downloadFinished) {
+ {{ download.downloadFinished | date: "fullDate" }}
+ {{ download.downloadFinished | date: "mediumTime" }}
+ } @else {
+ (not finished yet)
+ }
+
+
+
+ @if (download.unpackingQueued) {
+ {{ download.unpackingQueued | date: "fullDate" }}
+ {{ download.unpackingQueued | date: "mediumTime" }}
+ } @else {
+ (not queued for unpacking yet)
+ }
+
+
+
+ @if (download.unpackingStarted) {
+ {{ download.unpackingStarted | date: "fullDate" }}
+ {{ download.unpackingStarted | date: "mediumTime" }}
+ } @else {
+ (not started unpacking yet)
+ }
+
+
+
+ @if (download.unpackingFinished) {
+ {{ download.unpackingFinished | date: "fullDate" }}
+ {{ download.unpackingFinished | date: "mediumTime" }}
+ } @else {
+ (not finished unpacking yet)
+ }
+
+
+
+ @if (download.completed) {
+ {{ download.completed | date: "fullDate" }}
+ {{ download.completed | date: "mediumTime" }}
+ } @else {
+ (not completed yet)
+ }
+
+ |
+ ||||||||||||||||||||