From 3d551ac45bb865c4aebbd07937f8677afe14c542 Mon Sep 17 00:00:00 2001 From: thsrite Date: Sat, 20 Apr 2024 18:48:02 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E8=AE=A2=E9=98=85=E6=97=B6=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E8=A7=84=E5=88=99=E7=A7=BB=E5=88=B0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=AE=A2=E9=98=85=E8=A7=84=E5=88=99=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/dialog/SubscribeEditDialog.vue | 13 +++++- src/views/discover/MediaDetailView.vue | 42 ++++++++++--------- src/views/setting/AccountSettingSubscribe.vue | 10 +---- 3 files changed, 35 insertions(+), 30 deletions(-) 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表示不过滤" /> - - -