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