Skip to content

Commit

Permalink
feat: run external program on torrent completion #258
Browse files Browse the repository at this point in the history
  • Loading branch information
WDaan committed Nov 27, 2021
1 parent a7cc03c commit 99fa1c4
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 23 deletions.
74 changes: 53 additions & 21 deletions src/components/Modals/SettingsModal/Tabs/Downloads.vue
Expand Up @@ -64,26 +64,58 @@
/>
</v-list-item>
<v-list-item>
<v-row dense>
<v-col>
<v-checkbox
v-model="settings.temp_path_enabled"
hide-details
class="ma-0 pa-0"
label="Keep incomplete torrents in:"
/>
</v-col>
<v-col>
<v-text-field
v-model="settings.temp_path"
class="mb-2"
outlined
dense
hide-details
:disabled="!settings.temp_path_enabled"
/>
</v-col>
</v-row>
<v-checkbox
v-model="settings.temp_path_enabled"
hide-details
class="ma-0 pa-0"
label="Keep incomplete torrents in:"
/>
</v-list-item>
<v-list-item v-if="settings.temp_path_enabled">
<v-text-field
v-model="settings.temp_path"
class="mb-2"
outlined
dense
hide-details
/>
</v-list-item>
<v-list-item>
<v-checkbox
v-model="settings.autorun_enabled"
hide-details
class="ma-0 pa-0"
label="Autorun enabled:"
/>
</v-list-item>
<v-list-item v-if="settings.autorun_enabled">
<v-text-field
v-model="settings.autorun_program"
class="mb-2"
outlined
dense
label="Autorun program"
hide-details
/>
</v-list-item>
<v-list-item v-if="settings.autorun_enabled" class="mb-4">
<v-card flat color="grey--text selected">
<v-card-text>
<h5>Supported parameters (case sensitive):</h5>
<ul>
<li>%N: Torrent name </li>
<li>%L: Category</li>
<li>%G: Tags (separated by comma)</li>
<li>%F: Content path (same as root path for multi-file torrent)</li>
<li>%R: Root path (first torrent subdirectory path)</li>
<li>%D: Save path</li>
<li>%C: Number of files</li>
<li>%Z: Torrent size (bytes)</li>
<li>%T: Current tracker</li>
<li>%I: Info hash</li>
</ul>
</v-card-text>
</v-card>
</v-list-item>
</v-card>
</template>
Expand All @@ -94,4 +126,4 @@ export default {
name: 'Downloads',
mixins: [SettingsTab, FullScreenModal]
}
</script>
</script>
5 changes: 3 additions & 2 deletions src/store/actions.js
@@ -1,5 +1,6 @@
import Vue from 'vue'
import qbit from '../services/qbit'
import { i18n } from '../lang'

export default {
INIT_INTERVALS: async context => {
Expand All @@ -11,15 +12,15 @@ export default {
const res = await qbit.login(payload)
console.log(res)
if (res === 'Ok.') {
Vue.$toast.success(this.$t('toast.loginSuccess'))
Vue.$toast.success(i18n.t('toast.loginSuccess'))
context.commit('LOGIN', true)
context.commit('updateMainData')
context.commit('FETCH_SETTINGS')
context.commit('FETCH_CATEGORIES')

return true
}
Vue.$toast.error(this.$t('toast.loginFailed'))
Vue.$toast.error(i18n.t('toast.loginFailed'))

return false
}
Expand Down

0 comments on commit 99fa1c4

Please sign in to comment.