mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-04 23:18:44 +08:00
feat 详情页支持IMDBID搜索
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "moviepilot",
|
"name": "moviepilot",
|
||||||
"version": "1.0.5",
|
"version": "1.0.6",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite --host",
|
"dev": "vite --host",
|
||||||
|
|||||||
@@ -349,6 +349,7 @@ function handleSearch() {
|
|||||||
: `douban:${props.media?.douban_id}`
|
: `douban:${props.media?.douban_id}`
|
||||||
}`,
|
}`,
|
||||||
type: props.media?.type,
|
type: props.media?.type,
|
||||||
|
area: 'title',
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ const keyword = route.query?.keyword?.toString() ?? ''
|
|||||||
|
|
||||||
// 查询类型
|
// 查询类型
|
||||||
const type = route.query?.type?.toString() ?? ''
|
const type = route.query?.type?.toString() ?? ''
|
||||||
|
|
||||||
|
// 搜索字段
|
||||||
|
const area = route.query?.area?.toString() ?? ''
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -16,6 +19,7 @@ const type = route.query?.type?.toString() ?? ''
|
|||||||
<TorrentCardListView
|
<TorrentCardListView
|
||||||
:keyword="keyword"
|
:keyword="keyword"
|
||||||
:type="type"
|
:type="type"
|
||||||
|
:area="area"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -379,12 +379,13 @@ function joinArray(arr: string[]) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 开始搜索
|
// 开始搜索
|
||||||
function handleSearch() {
|
function handleSearch(area: string) {
|
||||||
router.push({
|
router.push({
|
||||||
path: '/resource',
|
path: '/resource',
|
||||||
query: {
|
query: {
|
||||||
keyword: `tmdb:${mediaDetail.value.tmdb_id}`,
|
keyword: `tmdb:${mediaDetail.value.tmdb_id}`,
|
||||||
type: mediaDetail.value.type,
|
type: mediaDetail.value.type,
|
||||||
|
area,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -440,11 +441,31 @@ onBeforeMount(() => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="media-actions">
|
<div class="media-actions">
|
||||||
<VBtn v-if="mediaDetail.tmdb_id" variant="tonal" color="info" @click="handleSearch">
|
<VBtn v-if="mediaDetail.tmdb_id" variant="tonal" color="info">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<VIcon icon="mdi-magnify" />
|
<VIcon icon="mdi-magnify" />
|
||||||
</template>
|
</template>
|
||||||
搜索
|
搜索资源
|
||||||
|
<VMenu
|
||||||
|
activator="parent"
|
||||||
|
close-on-content-click
|
||||||
|
>
|
||||||
|
<VList>
|
||||||
|
<VListItem
|
||||||
|
variant="plain"
|
||||||
|
@click="handleSearch('title')"
|
||||||
|
>
|
||||||
|
<VListItemTitle>标题</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
<VListItem
|
||||||
|
v-show="mediaDetail.imdb_id"
|
||||||
|
variant="plain"
|
||||||
|
@click="handleSearch('imdbid')"
|
||||||
|
>
|
||||||
|
<VListItemTitle>IMDB链接</VListItemTitle>
|
||||||
|
</VListItem>
|
||||||
|
</VList>
|
||||||
|
</VMenu>
|
||||||
</VBtn>
|
</VBtn>
|
||||||
<VBtn v-if="mediaDetail.type === '电影'" class="ms-2" :color="getSubscribeColor" variant="tonal" @click="handleSubscribe(0)">
|
<VBtn v-if="mediaDetail.type === '电影'" class="ms-2" :color="getSubscribeColor" variant="tonal" @click="handleSubscribe(0)">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ const props = defineProps({
|
|||||||
|
|
||||||
// 类型
|
// 类型
|
||||||
type: String,
|
type: String,
|
||||||
|
|
||||||
|
// 搜索字段
|
||||||
|
area: String,
|
||||||
})
|
})
|
||||||
|
|
||||||
interface SearchTorrent extends Context {
|
interface SearchTorrent extends Context {
|
||||||
@@ -124,6 +127,7 @@ async function fetchData(): Promise<Array<Context>> {
|
|||||||
let searchData: Array<Context>
|
let searchData: Array<Context>
|
||||||
const keyword = props.keyword ?? ''
|
const keyword = props.keyword ?? ''
|
||||||
const mtype = props.type ?? ''
|
const mtype = props.type ?? ''
|
||||||
|
const area = props.area ?? ''
|
||||||
if (!keyword) {
|
if (!keyword) {
|
||||||
// 查询上次搜索结果
|
// 查询上次搜索结果
|
||||||
searchData = await api.get('search/last')
|
searchData = await api.get('search/last')
|
||||||
@@ -136,6 +140,7 @@ async function fetchData(): Promise<Array<Context>> {
|
|||||||
searchData = await api.get(`search/media/${props.keyword}`, {
|
searchData = await api.get(`search/media/${props.keyword}`, {
|
||||||
params: {
|
params: {
|
||||||
mtype,
|
mtype,
|
||||||
|
area,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user