diff --git a/src/components/dialog/SubscribeEditDialog.vue b/src/components/dialog/SubscribeEditDialog.vue index d0708c16..d6b6ad18 100644 --- a/src/components/dialog/SubscribeEditDialog.vue +++ b/src/components/dialog/SubscribeEditDialog.vue @@ -43,7 +43,8 @@ const subscribeForm = ref({ username: '', current_priority: 0, save_path: '', - date: '' + date: '', + show_edit_dialog: false }) // 提示框 @@ -413,6 +414,16 @@ onMounted(() => { hint="开启后将使用 ImdbID 搜索资源,搜索结果更精确,但不是所有站点都支持" /> + + + diff --git a/src/views/discover/MediaDetailView.vue b/src/views/discover/MediaDetailView.vue index 0d0c013b..9191e529 100644 --- a/src/views/discover/MediaDetailView.vue +++ b/src/views/discover/MediaDetailView.vue @@ -46,10 +46,8 @@ const seasonsSubscribed = ref<{ [key: number]: boolean }>({}) // 订阅编号 const subscribeId = ref() -// 订阅规则 -const subscribeRules = ref({ - show_edit_dialog: false, -}) +// 是否显示编辑订阅弹窗 +const showEditDialog = ref(false) // 获得mediaid function getMediaId() { @@ -230,7 +228,7 @@ async function addSubscribe(season = 0) { ) // 显示编辑弹窗 - if (result.success && subscribeRules.value.show_edit_dialog) { + if (result.success && showEditDialog.value) { subscribeId.value = result.data.id subscribeEditDialog.value = true } @@ -290,20 +288,6 @@ async function removeSubscribe(season: number) { doneNProgress() } -// 查询订阅弹窗规则 -async function querySubscribeRules() { - try { - const result: { [key: string]: any } = await api.get( - 'system/setting/DefaultFilterRules', - ) - if (result.data?.value) - subscribeRules.value = result.data?.value - } - catch (error) { - console.log(error) - } -} - // 订阅按钮响应 function handleSubscribe(season = 0) { if (isSubscribed.value) @@ -450,9 +434,27 @@ async function handlePlay() { } } +async function queryDefaultSubscribeConfig() { + try { + let subscribe_config_url = '' + if (mediaProps.type === '电影') + subscribe_config_url = 'system/setting/DefaultMovieSubscribeConfig' + else + subscribe_config_url = 'system/setting/DefaultTvSubscribeConfig' + + const result: { [key: string]: any } = await api.get(subscribe_config_url) + + if (result.data.value && result.data.value.show_edit_dialog) + showEditDialog.value = true + } + catch (error) { + console.log(error) + } +} + onBeforeMount(() => { getMediaDetail() - querySubscribeRules() + queryDefaultSubscribeConfig() }) diff --git a/src/views/setting/AccountSettingSubscribe.vue b/src/views/setting/AccountSettingSubscribe.vue index f242ed33..1dca788e 100644 --- a/src/views/setting/AccountSettingSubscribe.vue +++ b/src/views/setting/AccountSettingSubscribe.vue @@ -41,8 +41,7 @@ const defaultFilterRules = ref({ exclude: '', movie_size: '', tv_size: '', - min_seeders: 0, - show_edit_dialog: false, + min_seeders: 0 }) // 订阅模式选择项 @@ -622,13 +621,6 @@ onMounted(() => { hint="小于该值的资源将被过滤掉,0表示不过滤" /> - - -