mirror of
https://github.com/VueTorrent/VueTorrent.git
synced 2025-03-14 03:59:53 +03:00
fix(TRC): Use all selected torrents for transfer limits (#1329)
This commit is contained in:
parent
179af5a1d6
commit
3614081f19
3 changed files with 14 additions and 14 deletions
|
@ -94,15 +94,15 @@ async function copyValue(valueToCopy: string) {
|
|||
}
|
||||
|
||||
function setDownloadLimit() {
|
||||
dialogStore.createDialog(SpeedLimitDialog, { hash: hash.value, mode: 'download' })
|
||||
dialogStore.createDialog(SpeedLimitDialog, { hashes: hashes.value, mode: 'download' })
|
||||
}
|
||||
|
||||
function setUploadLimit() {
|
||||
dialogStore.createDialog(SpeedLimitDialog, { hash: hash.value, mode: 'upload' })
|
||||
dialogStore.createDialog(SpeedLimitDialog, { hashes: hashes.value, mode: 'upload' })
|
||||
}
|
||||
|
||||
function setShareLimit() {
|
||||
dialogStore.createDialog(ShareLimitDialog, { hash: hash.value })
|
||||
dialogStore.createDialog(ShareLimitDialog, { hashes: hashes.value })
|
||||
}
|
||||
|
||||
async function exportTorrents() {
|
||||
|
|
|
@ -9,7 +9,7 @@ const DISABLED = -1
|
|||
|
||||
const props = defineProps<{
|
||||
guid: string
|
||||
hash: string
|
||||
hashes: string[]
|
||||
}>()
|
||||
|
||||
const { isOpened } = useDialog(props.guid)
|
||||
|
@ -38,13 +38,13 @@ function close() {
|
|||
async function submit() {
|
||||
switch (shareType.value) {
|
||||
case 'global':
|
||||
await maindataStore.setShareLimit([props.hash], GLOBAL, GLOBAL, GLOBAL)
|
||||
await maindataStore.setShareLimit(props.hashes, GLOBAL, GLOBAL, GLOBAL)
|
||||
break
|
||||
case 'disabled':
|
||||
await maindataStore.setShareLimit([props.hash], DISABLED, DISABLED, DISABLED)
|
||||
await maindataStore.setShareLimit(props.hashes, DISABLED, DISABLED, DISABLED)
|
||||
break
|
||||
case 'enabled':
|
||||
await maindataStore.setShareLimit([props.hash],
|
||||
await maindataStore.setShareLimit(props.hashes,
|
||||
ratioLimitEnabled.value ? ratioLimit.value : DISABLED,
|
||||
seedingTimeLimitEnabled.value ? seedingTimeLimit.value : DISABLED,
|
||||
inactiveSeedingTimeLimitEnabled.value ? inactiveSeedingTimeLimit.value : DISABLED)
|
||||
|
@ -54,7 +54,7 @@ async function submit() {
|
|||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const torrent = torrentStore.getTorrentByHash(props.hash)
|
||||
const torrent = torrentStore.getTorrentByHash(props.hashes[0])
|
||||
if (!torrent) {
|
||||
return close()
|
||||
}
|
||||
|
@ -131,4 +131,4 @@ onBeforeMount(async () => {
|
|||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -5,7 +5,7 @@ import { onBeforeMount, ref } from 'vue'
|
|||
|
||||
const props = defineProps<{
|
||||
guid: string
|
||||
hash: string
|
||||
hashes: string[]
|
||||
mode: 'download' | 'upload'
|
||||
}>()
|
||||
|
||||
|
@ -24,17 +24,17 @@ async function submit() {
|
|||
const formattedValue = Math.max(0, value.value) * 1000
|
||||
switch (props.mode) {
|
||||
case 'download':
|
||||
await maindataStore.setDownloadLimit(formattedValue, [props.hash])
|
||||
await maindataStore.setDownloadLimit(formattedValue, props.hashes)
|
||||
break
|
||||
case 'upload':
|
||||
await maindataStore.setUploadLimit(formattedValue, [props.hash])
|
||||
await maindataStore.setUploadLimit(formattedValue, props.hashes)
|
||||
break
|
||||
}
|
||||
close()
|
||||
}
|
||||
|
||||
onBeforeMount(async () => {
|
||||
const torrent = torrentStore.getTorrentByHash(props.hash)
|
||||
const torrent = torrentStore.getTorrentByHash(props.hashes[0])
|
||||
if (!torrent) {
|
||||
return close()
|
||||
}
|
||||
|
@ -76,4 +76,4 @@ onBeforeMount(async () => {
|
|||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
Loading…
Add table
Reference in a new issue