diff --git a/src/components/Torrents.vue b/src/components/Torrents.vue
index a1ded1d..539fce3 100644
--- a/src/components/Torrents.vue
+++ b/src/components/Torrents.vue
@@ -141,6 +141,7 @@
+
Delete torrents
- Are you sure you want to delete the selected torrents from the transfer list?
+ Are you sure to delete selected torrents from transfer list?
-
{{ row.name }}
@@ -49,6 +49,7 @@ import _ from 'lodash';
import Vue from 'vue';
import api from '@/Api';
import { mapGetters } from 'vuex';
+import { getSameNamedTorrents } from '@/utils';
export default Vue.extend({
props: {
@@ -65,7 +66,7 @@ export default Vue.extend({
},
created() {
this.torrents = this.value;
- this.sameNamedTorrents = this.getSameNamedTorrents();
+ this.sameNamedTorrents = getSameNamedTorrents(this.allTorrents, this.torrents);
},
computed: {
...mapGetters(['allTorrents']),
@@ -77,26 +78,6 @@ export default Vue.extend({
closeDialog() {
this.$emit('input', []);
},
- getSameNamedTorrents() {
- const hashes = _.map(this.torrents, (t) => t.hash);
- const result = [];
- for (const t1 of this.torrents) {
- for (const t2 of this.allTorrents) {
- if (hashes.includes(t2.hash)) {
- continue;
- }
-
- if (t1.name != t2.name) {
- continue;
- }
-
- result.push(t2);
- hashes.push(t2);
- }
- }
-
- return result;
- },
async submit() {
if (this.submitting) {
return;
diff --git a/src/components/dialogs/ConfirmSetCategoryDialog.vue b/src/components/dialogs/ConfirmSetCategoryDialog.vue
new file mode 100644
index 0000000..7005ed0
--- /dev/null
+++ b/src/components/dialogs/ConfirmSetCategoryDialog.vue
@@ -0,0 +1,118 @@
+
+
+
+
+ mdi-folder
+ Set category
+
+
+
+ Are you sure to move selected torrents to category {{ category }}?
+
+
+ Are you sure to reset category of selected torrents?
+
+
+ -
+ {{ row.name }}
+
+
+
+
+
+
+
+ Cancel
+
+ Submit
+
+
+
+
+
+
+
+
+
diff --git a/src/utils.ts b/src/utils.ts
index 0788791..658d34b 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -66,3 +66,24 @@ export function codeToFlag(code: string) {
}
export const isWindows = navigator.userAgent.includes('Windows');
+
+export function getSameNamedTorrents(allTorrents: Array, torrents: Array) {
+ const hashes = _.map(torrents, (t) => t.hash);
+ const result = [];
+ for (const t1 of torrents) {
+ for (const t2 of allTorrents) {
+ if (hashes.includes(t2.hash)) {
+ continue;
+ }
+
+ if (t1.name != t2.name) {
+ continue;
+ }
+
+ result.push(t2);
+ hashes.push(t2);
+ }
+ }
+
+ return result;
+};
\ No newline at end of file