Merge remote-tracking branch 'origin/main'

This commit is contained in:
thsrite
2023-08-28 11:04:20 +08:00
20 changed files with 1295 additions and 33 deletions

View File

@@ -379,12 +379,13 @@ function joinArray(arr: string[]) {
}
// 开始搜索
function handleSearch() {
function handleSearch(area: string) {
router.push({
path: '/resource',
query: {
keyword: `tmdb:${mediaDetail.value.tmdb_id}`,
type: mediaDetail.value.type,
area,
},
})
}
@@ -442,11 +443,31 @@ onBeforeMount(() => {
</span>
</div>
<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>
<VIcon icon="mdi-magnify" />
</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 v-if="mediaDetail.type === '电影'" class="ms-2" :color="getSubscribeColor" variant="tonal" @click="handleSubscribe(0)">
<template #prepend>

View File

@@ -13,6 +13,9 @@ const props = defineProps({
// 类型
type: String,
// 搜索字段
area: String,
})
interface SearchTorrent extends Context {
@@ -124,6 +127,7 @@ async function fetchData(): Promise<Array<Context>> {
let searchData: Array<Context>
const keyword = props.keyword ?? ''
const mtype = props.type ?? ''
const area = props.area ?? ''
if (!keyword) {
// 查询上次搜索结果
searchData = await api.get('search/last')
@@ -136,6 +140,7 @@ async function fetchData(): Promise<Array<Context>> {
searchData = await api.get(`search/media/${props.keyword}`, {
params: {
mtype,
area,
},
})
}

View File

@@ -0,0 +1,28 @@
<script lang="ts" setup>
import api from '@/api'
import type { Setting } from '@/api/types'
import FileBrowser from '@/components/FileBrowser.vue'
const endpoints = {
list: { url: '/filebrowser/list?path={path}', method: 'get' },
mkdir: { url: '/filebrowser/mkdir?path={path}', method: 'get' },
delete: { url: '/filebrowser/delete?path={path}', method: 'get' },
download: { url: '/filebrowser/download?path={path}', method: 'get' },
image: { url: '/filebrowser/image?path={path}', method: 'get' },
rename: { url: '/filebrowser/rename?path={path}&new_name={newname}', method: 'get' },
}
// 读取下载目录
const systemEnv: Setting = inject('systemEnv') ?? {
DOWNLOAD_PATH: '/',
}
if (systemEnv?.DOWNLOAD_PATH && !systemEnv.DOWNLOAD_PATH?.endsWith('/'))
systemEnv.DOWNLOAD_PATH += '/'
</script>
<template>
<div>
<FileBrowser storages="local" :tree="false" :path="systemEnv?.DOWNLOAD_PATH" :endpoints="endpoints" :axios="api" />
</div>
</template>

View File

@@ -40,7 +40,7 @@ async function querySelectedSites() {
try {
const result: { [key: string]: any } = await api.get('system/setting/IndexerSites')
selectedSites.value = result.data?.value
selectedSites.value = result.data?.value ?? []
}
catch (error) {
console.log(error)