mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 07:28:37 +08:00
Merge pull request #108 from thsrite/main
This commit is contained in:
@@ -157,7 +157,7 @@ async function addSubscribe(season = 0) {
|
|||||||
|
|
||||||
// 弹出订阅编辑弹窗
|
// 弹出订阅编辑弹窗
|
||||||
if (result.success && seasonsSelected.value.length <= 1) {
|
if (result.success && seasonsSelected.value.length <= 1) {
|
||||||
const show_edit_dialog = await querySubscribeRules()
|
const show_edit_dialog = await queryDefaultSubscribeConfig()
|
||||||
if (show_edit_dialog) {
|
if (show_edit_dialog) {
|
||||||
subscribeId.value = result.data.id
|
subscribeId.value = result.data.id
|
||||||
subscribeEditDialog.value = true
|
subscribeEditDialog.value = true
|
||||||
@@ -313,11 +313,16 @@ async function getMediaSeasons() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询订阅弹窗规则
|
// 查询订阅弹窗规则
|
||||||
async function querySubscribeRules() {
|
async function queryDefaultSubscribeConfig() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get(
|
let subscribe_config_url = ''
|
||||||
'system/setting/DefaultFilterRules',
|
if (props.media?.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)
|
if (result.data?.value)
|
||||||
return result.data.value.show_edit_dialog
|
return result.data.value.show_edit_dialog
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ const subscribeForm = ref<Subscribe>({
|
|||||||
username: '',
|
username: '',
|
||||||
current_priority: 0,
|
current_priority: 0,
|
||||||
save_path: '',
|
save_path: '',
|
||||||
date: ''
|
date: '',
|
||||||
|
show_edit_dialog: false
|
||||||
})
|
})
|
||||||
|
|
||||||
// 提示框
|
// 提示框
|
||||||
@@ -413,6 +414,16 @@ onMounted(() => {
|
|||||||
hint="开启后将使用 ImdbID 搜索资源,搜索结果更精确,但不是所有站点都支持"
|
hint="开启后将使用 ImdbID 搜索资源,搜索结果更精确,但不是所有站点都支持"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
|
<VCol v-if="props.default"
|
||||||
|
cols="12"
|
||||||
|
md="4"
|
||||||
|
>
|
||||||
|
<VSwitch
|
||||||
|
v-model="subscribeForm.show_edit_dialog"
|
||||||
|
label="订阅时编辑更多规则"
|
||||||
|
hint="开启后将在添加订阅后弹出编辑订阅的对话框,方便用户编辑订阅规则"
|
||||||
|
/>
|
||||||
|
</VCol>
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|||||||
@@ -46,11 +46,6 @@ const seasonsSubscribed = ref<{ [key: number]: boolean }>({})
|
|||||||
// 订阅编号
|
// 订阅编号
|
||||||
const subscribeId = ref<number>()
|
const subscribeId = ref<number>()
|
||||||
|
|
||||||
// 订阅规则
|
|
||||||
const subscribeRules = ref({
|
|
||||||
show_edit_dialog: false,
|
|
||||||
})
|
|
||||||
|
|
||||||
// 获得mediaid
|
// 获得mediaid
|
||||||
function getMediaId() {
|
function getMediaId() {
|
||||||
return mediaDetail.value?.tmdb_id
|
return mediaDetail.value?.tmdb_id
|
||||||
@@ -230,9 +225,12 @@ async function addSubscribe(season = 0) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
// 显示编辑弹窗
|
// 显示编辑弹窗
|
||||||
if (result.success && subscribeRules.value.show_edit_dialog) {
|
if (result.success) {
|
||||||
subscribeId.value = result.data.id
|
const show_edit_dialog = await queryDefaultSubscribeConfig()
|
||||||
subscribeEditDialog.value = true
|
if (show_edit_dialog) {
|
||||||
|
subscribeId.value = result.data.id
|
||||||
|
subscribeEditDialog.value = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
@@ -290,20 +288,6 @@ async function removeSubscribe(season: number) {
|
|||||||
doneNProgress()
|
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) {
|
function handleSubscribe(season = 0) {
|
||||||
if (isSubscribed.value)
|
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)
|
||||||
|
return result.data.value.show_edit_dialog
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
console.log(error)
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
onBeforeMount(() => {
|
onBeforeMount(() => {
|
||||||
getMediaDetail()
|
getMediaDetail()
|
||||||
querySubscribeRules()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -41,8 +41,7 @@ const defaultFilterRules = ref({
|
|||||||
exclude: '',
|
exclude: '',
|
||||||
movie_size: '',
|
movie_size: '',
|
||||||
tv_size: '',
|
tv_size: '',
|
||||||
min_seeders: 0,
|
min_seeders: 0
|
||||||
show_edit_dialog: false,
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// 订阅模式选择项
|
// 订阅模式选择项
|
||||||
@@ -622,13 +621,6 @@ onMounted(() => {
|
|||||||
hint="小于该值的资源将被过滤掉,0表示不过滤"
|
hint="小于该值的资源将被过滤掉,0表示不过滤"
|
||||||
/>
|
/>
|
||||||
</VCol>
|
</VCol>
|
||||||
<VCol cols="12" md="6">
|
|
||||||
<VSwitch
|
|
||||||
v-model="defaultFilterRules.show_edit_dialog"
|
|
||||||
label="订阅时编辑更多规则"
|
|
||||||
hint="开启后,添加订阅时将自动弹出订阅编辑框,要设置更多订阅选项"
|
|
||||||
/>
|
|
||||||
</VCol>
|
|
||||||
</VRow>
|
</VRow>
|
||||||
</VForm>
|
</VForm>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
|||||||
Reference in New Issue
Block a user