mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 08:46:40 +08:00
fix
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import type { PropType, Ref } from 'vue'
|
import type { PropType, Ref } from 'vue'
|
||||||
import { useToast } from 'vue-toast-notification'
|
import { useToast } from 'vue-toast-notification'
|
||||||
import { formatSeason } from '@/@core/utils/formatters'
|
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
import { doneNProgress, startNProgress } from '@/api/nprogress'
|
||||||
import type { MediaInfo, NotExistMediaInfo, Subscribe, TmdbSeason } from '@/api/types'
|
import type { MediaInfo, NotExistMediaInfo, Subscribe, TmdbSeason } from '@/api/types'
|
||||||
@@ -119,16 +118,11 @@ async function addSubscribe(season = 0) {
|
|||||||
if (result.success) {
|
if (result.success) {
|
||||||
// 订阅成功
|
// 订阅成功
|
||||||
isSubscribed.value = true
|
isSubscribed.value = true
|
||||||
|
$toast.success(`${result.message}`)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$toast.error(`${result.message}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 提示
|
|
||||||
showSubscribeAddToast(
|
|
||||||
result.success,
|
|
||||||
props.media?.title ?? '',
|
|
||||||
season,
|
|
||||||
result.message,
|
|
||||||
isExists.value,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
catch (error) {
|
catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
@@ -136,25 +130,6 @@ async function addSubscribe(season = 0) {
|
|||||||
doneNProgress()
|
doneNProgress()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 弹出添加订阅提示
|
|
||||||
function showSubscribeAddToast(result: boolean,
|
|
||||||
title: string,
|
|
||||||
season: number,
|
|
||||||
message: string,
|
|
||||||
isExists: boolean) {
|
|
||||||
if (season)
|
|
||||||
title = `${title} ${formatSeason(season.toString())}`
|
|
||||||
|
|
||||||
let subname = '订阅'
|
|
||||||
if (isExists)
|
|
||||||
subname = '洗版订阅'
|
|
||||||
|
|
||||||
if (result)
|
|
||||||
$toast.success(`${title} 添加${subname}成功!`)
|
|
||||||
else
|
|
||||||
$toast.error(`${title} 添加${subname}失败:${message}!`)
|
|
||||||
}
|
|
||||||
|
|
||||||
// 调用API取消订阅
|
// 调用API取消订阅
|
||||||
async function removeSubscribe() {
|
async function removeSubscribe() {
|
||||||
// 开始处理
|
// 开始处理
|
||||||
@@ -288,19 +263,6 @@ function handleSubscribe() {
|
|||||||
handleAddSubscribe()
|
handleAddSubscribe()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 拼装详情页链接
|
|
||||||
function getDetailLink() {
|
|
||||||
let link = ''
|
|
||||||
if (props.media?.douban_id)
|
|
||||||
link = `https://movie.douban.com/subject/${props.media?.douban_id}/`
|
|
||||||
else if (props.media?.type === '电影')
|
|
||||||
link = `https://www.themoviedb.org/movie/${props.media?.tmdb_id}`
|
|
||||||
else if (props.media?.type === '电视剧')
|
|
||||||
link = `https://www.themoviedb.org/tv/${props.media?.tmdb_id}`
|
|
||||||
|
|
||||||
return link
|
|
||||||
}
|
|
||||||
|
|
||||||
// 计算存在状态的颜色
|
// 计算存在状态的颜色
|
||||||
function getExistColor(season: number) {
|
function getExistColor(season: number) {
|
||||||
const state = seasonsNotExisted.value[season]
|
const state = seasonsNotExisted.value[season]
|
||||||
|
|||||||
Reference in New Issue
Block a user