mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-06-16 13:11:22 +08:00
fix: show subtitle episode metadata
This commit is contained in:
@@ -812,6 +812,12 @@ export interface SubtitleInfo {
|
||||
subtitle_id?: string
|
||||
// 下载文件名
|
||||
file_name?: string
|
||||
// 识别元数据
|
||||
meta_info?: MetaInfo
|
||||
// SxxExx
|
||||
season_episode?: string
|
||||
// 集列表
|
||||
episode_list?: number[]
|
||||
}
|
||||
|
||||
// 识别元数据
|
||||
|
||||
@@ -127,6 +127,9 @@ watch(
|
||||
</div>
|
||||
|
||||
<div class="d-flex align-center gap-2">
|
||||
<VChip v-if="subtitle?.season_episode" size="x-small" color="secondary" variant="tonal" class="rounded-sm">
|
||||
{{ subtitle.season_episode }}
|
||||
</VChip>
|
||||
<VChip v-if="subtitle?.language" size="x-small" color="info" variant="tonal" class="rounded-sm">
|
||||
<VImg
|
||||
v-if="subtitle?.language_icon"
|
||||
|
||||
@@ -129,6 +129,9 @@ watch(
|
||||
<VListItemTitle class="whitespace-normal">
|
||||
<div class="d-flex flex-row flex-wrap align-center gap-2 mb-2">
|
||||
<span class="text-h6 font-weight-bold me-1">{{ subtitle?.site_name }}</span>
|
||||
<VChip v-if="subtitle?.season_episode" size="x-small" color="secondary" variant="tonal" class="rounded-sm">
|
||||
{{ subtitle.season_episode }}
|
||||
</VChip>
|
||||
<VChip v-if="subtitle?.language" size="x-small" color="info" variant="tonal" class="rounded-sm">
|
||||
<VImg
|
||||
v-if="subtitle?.language_icon"
|
||||
|
||||
@@ -82,6 +82,17 @@ const selectedSites = ref<number[]>([])
|
||||
// 搜索方式 title/imdbid
|
||||
const searchType = ref('title')
|
||||
|
||||
interface MediaSearchOptions {
|
||||
season?: number | null
|
||||
episode?: number | null
|
||||
}
|
||||
|
||||
// 站点选择后待执行的搜索类型
|
||||
const pendingSearchResultType = ref<'torrent' | 'subtitle'>('torrent')
|
||||
|
||||
// 站点选择后待执行的季集参数
|
||||
const pendingSearchOptions = ref<MediaSearchOptions>({})
|
||||
|
||||
// 计算主题是否为透明
|
||||
const isTransparentTheme = computed(() => {
|
||||
return theme.name.value === 'transparent'
|
||||
@@ -494,11 +505,6 @@ function joinArray(arr: string[]) {
|
||||
return arr.join('、')
|
||||
}
|
||||
|
||||
interface MediaSearchOptions {
|
||||
season?: number | null
|
||||
episode?: number | null
|
||||
}
|
||||
|
||||
// 开始搜索
|
||||
function handleSearch(resultType: 'torrent' | 'subtitle' = 'torrent', options: MediaSearchOptions = {}) {
|
||||
const keyword = getMediaId()
|
||||
@@ -563,9 +569,11 @@ function onSubscribeEditRemove() {
|
||||
else checkSeasonsSubscribed()
|
||||
}
|
||||
|
||||
// 点击搜索
|
||||
async function clickSearch(type: string) {
|
||||
// 搜索前弹出站点选择框,确认后执行资源或字幕搜索。
|
||||
async function clickSearch(type: string, resultType: 'torrent' | 'subtitle' = 'torrent', options: MediaSearchOptions = {}) {
|
||||
searchType.value = type
|
||||
pendingSearchResultType.value = resultType
|
||||
pendingSearchOptions.value = options
|
||||
if (allSites.value?.length == 0) {
|
||||
await querySites()
|
||||
await querySelectedSites()
|
||||
@@ -573,24 +581,24 @@ async function clickSearch(type: string) {
|
||||
if (allSites.value?.length > 0) {
|
||||
openSearchSiteDialog()
|
||||
} else {
|
||||
handleSearch()
|
||||
handleSearch(pendingSearchResultType.value, pendingSearchOptions.value)
|
||||
}
|
||||
}
|
||||
|
||||
// 搜索多站点
|
||||
function searchSites(sites: number[]) {
|
||||
selectedSites.value = sites
|
||||
handleSearch()
|
||||
handleSearch(pendingSearchResultType.value, pendingSearchOptions.value)
|
||||
}
|
||||
|
||||
// 搜索字幕
|
||||
function handleSubtitleSearch() {
|
||||
handleSearch('subtitle')
|
||||
async function handleSubtitleSearch() {
|
||||
await clickSearch('title', 'subtitle')
|
||||
}
|
||||
|
||||
// 搜索单集字幕
|
||||
function handleEpisodeSubtitleSearch(season: number | null, episode: number | null) {
|
||||
handleSearch('subtitle', { season, episode })
|
||||
async function handleEpisodeSubtitleSearch(season: number | null, episode: number | null) {
|
||||
await clickSearch('title', 'subtitle', { season, episode })
|
||||
}
|
||||
|
||||
onBeforeMount(() => {
|
||||
|
||||
Reference in New Issue
Block a user