From 14792bcb0ad6731a3a70c5cf4894f4765ad71a31 Mon Sep 17 00:00:00 2001
From: slikie <13197246+slikie@users.noreply.github.com>
Date: Sun, 30 May 2021 12:49:16 +0800
Subject: [PATCH] [feature] allow toggle sequential download (#104)
---
src/Api.ts | 4 ++++
src/components/Torrents.vue | 18 ++++++++++++++++--
src/locale/en.ts | 1 +
3 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/src/Api.ts b/src/Api.ts
index 05b86cc..1d64ece 100644
--- a/src/Api.ts
+++ b/src/Api.ts
@@ -157,6 +157,10 @@ class Api {
return this.actionTorrents('setForceStart', hashes, { value: 'true' });
}
+ public toggleSequentialTorrents(hashes: string[]) {
+ return this.actionTorrents('toggleSequentialDownload', hashes);
+ }
+
public reannounceTorrents(hashes: string[]) {
return this.actionTorrents('reannounce', hashes);
}
diff --git a/src/components/Torrents.vue b/src/components/Torrents.vue
index 65724ad..ccca4a8 100644
--- a/src/components/Torrents.vue
+++ b/src/components/Torrents.vue
@@ -102,6 +102,14 @@
vertical
inset
/>
+
+ mdi-transit-connection-variant
+
@@ -352,11 +360,14 @@ function getStateInfo(state: string) {
const item = getStateInfo(state);
return `mdi-${item.icon}`;
},
- stateColor(state: string, isProgress?: boolean) {
+ stateColor(state: string, isProgress?: boolean, isSeqDL?: boolean) {
const item = getStateInfo(state);
if (!isProgress) {
return item.color;
}
+ if (isSeqDL) {
+ return '#e33371' // icon.color.secondary;
+ }
return item.color || '#0008';
},
@@ -480,6 +491,9 @@ export default class Torrents extends Vue {
await api.setForceStartTorrents(this.selectedHashes);
}
+ async toggleSequentialTorrents() {
+ await api.toggleSequentialTorrents(this.selectedHashes);
+ }
async pauseTorrents() {
await api.pauseTorrents(this.selectedHashes);
}
diff --git a/src/locale/en.ts b/src/locale/en.ts
index 33f411e..58b8b70 100644
--- a/src/locale/en.ts
+++ b/src/locale/en.ts
@@ -18,6 +18,7 @@ export default {
resume: 'Resume',
pause: 'Pause',
force_start: 'Force Start',
+ toggle_sequential: 'Toggle Sequential Download',
info: 'Info',
reset: 'Reset',
login: 'Login',