mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
feat(subscribe): 添加下载器选项到订阅设置
This commit is contained in:
@@ -72,6 +72,8 @@ export interface Subscribe {
|
|||||||
media_category?: string
|
media_category?: string
|
||||||
// 过滤规则组
|
// 过滤规则组
|
||||||
filter_groups?: string[]
|
filter_groups?: string[]
|
||||||
|
// 下载器
|
||||||
|
downloader?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
// 订阅分享
|
// 订阅分享
|
||||||
|
|||||||
@@ -67,10 +67,13 @@ async function loadDownloaderSetting() {
|
|||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/Downloaders')
|
const result: { [key: string]: any } = await api.get('system/setting/Downloaders')
|
||||||
const downloaders = result.data?.value ?? []
|
const downloaders = result.data?.value ?? []
|
||||||
downloaderOptions.value = [{ title: '默认下载器', value: null }, ...downloaders.map((item: { name: any }) => ({
|
downloaderOptions.value = [
|
||||||
title: item.name,
|
{ title: '默认', value: null },
|
||||||
value: item.name,
|
...downloaders.map((item: { name: any }) => ({
|
||||||
}))]
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
})),
|
||||||
|
]
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载下载器设置失败:', error)
|
console.error('加载下载器设置失败:', error)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,25 @@ const subscribeForm = ref<Subscribe>({
|
|||||||
// 提示框
|
// 提示框
|
||||||
const $toast = useToast()
|
const $toast = useToast()
|
||||||
|
|
||||||
|
// 下载器选项
|
||||||
|
const downloaderOptions = ref<{ title: string; value: string }[]>([])
|
||||||
|
|
||||||
|
async function loadDownloaderSetting() {
|
||||||
|
try {
|
||||||
|
const result: { [key: string]: any } = await api.get('system/setting/Downloaders')
|
||||||
|
const downloaders = result.data?.value ?? []
|
||||||
|
downloaderOptions.value = [
|
||||||
|
{ title: '默认', value: null },
|
||||||
|
...downloaders.map((item: { name: any }) => ({
|
||||||
|
title: item.name,
|
||||||
|
value: item.name,
|
||||||
|
})),
|
||||||
|
]
|
||||||
|
} catch (error) {
|
||||||
|
console.error('加载下载器设置失败:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 加载规则组
|
// 加载规则组
|
||||||
async function queryFilterRuleGroups() {
|
async function queryFilterRuleGroups() {
|
||||||
try {
|
try {
|
||||||
@@ -292,6 +311,7 @@ onMounted(() => {
|
|||||||
queryFilterRuleGroups()
|
queryFilterRuleGroups()
|
||||||
loadDownloadDirectories()
|
loadDownloadDirectories()
|
||||||
getSiteList()
|
getSiteList()
|
||||||
|
loadDownloaderSetting()
|
||||||
if (props.subid) getSubscribeInfo()
|
if (props.subid) getSubscribeInfo()
|
||||||
if (props.default) queryDefaultSubscribeConfig()
|
if (props.default) queryDefaultSubscribeConfig()
|
||||||
})
|
})
|
||||||
@@ -392,6 +412,26 @@ onMounted(() => {
|
|||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
|
<VRow>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VSelect
|
||||||
|
v-model="subscribeForm.downloader"
|
||||||
|
:items="downloaderOptions"
|
||||||
|
label="下载器"
|
||||||
|
hint="指定该订阅使用的下载器,留空自动使用默认下载器"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
<VCol cols="12" md="6">
|
||||||
|
<VCombobox
|
||||||
|
v-model="subscribeForm.save_path"
|
||||||
|
:items="targetDirectories"
|
||||||
|
label="保存路径"
|
||||||
|
hint="指定该订阅的下载保存路径,留空自动使用设定的下载目录"
|
||||||
|
persistent-hint
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
<VRow>
|
<VRow>
|
||||||
<VCol cols="12" md="4">
|
<VCol cols="12" md="4">
|
||||||
<VSwitch
|
<VSwitch
|
||||||
@@ -461,15 +501,6 @@ onMounted(() => {
|
|||||||
persistent-hint
|
persistent-hint
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="6">
|
|
||||||
<VCombobox
|
|
||||||
v-model="subscribeForm.save_path"
|
|
||||||
:items="targetDirectories"
|
|
||||||
label="自定义保存路径"
|
|
||||||
hint="指定该订阅的下载保存路径,留空自动使用设定的下载目录"
|
|
||||||
persistent-hint
|
|
||||||
/>
|
|
||||||
</VCol>
|
|
||||||
</VRow>
|
</VRow>
|
||||||
<VRow v-if="!props.default">
|
<VRow v-if="!props.default">
|
||||||
<VCol cols="12">
|
<VCol cols="12">
|
||||||
|
|||||||
Reference in New Issue
Block a user