diff --git a/package.json b/package.json index b359f17e..f4b3961f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "moviepilot", - "version": "1.7.3", + "version": "1.7.4", "private": true, "bin": "dist/service.js", "scripts": { diff --git a/src/api/types.ts b/src/api/types.ts index 55a84427..d3deeeb3 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -181,6 +181,9 @@ export interface MediaInfo { // 豆瓣ID douban_id?: string + // Bangumi ID + bangumi_id?: string + // 媒体原语种 original_language?: string @@ -282,6 +285,9 @@ export interface MediaInfo { // 下一集 next_episode_to_air?: object + + // 别名 + names?: string[] } // TMDB季信息 @@ -422,6 +428,28 @@ export interface DoubanPerson { } +// Bangumi人物信息 +export interface BangumiPerson { + // ID + id?: number + + // 名称 + name?: string + + // 类型 + type?: number + + // 角色 + career?: string[] + + // images large/normal + images?: { [key: string]: string } + + // 关系 + relation?: string + +} + // 站点 export interface Site { diff --git a/src/components/cards/BangumiPersonCard.vue b/src/components/cards/BangumiPersonCard.vue new file mode 100644 index 00000000..cfec21e2 --- /dev/null +++ b/src/components/cards/BangumiPersonCard.vue @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + {{ personInfo?.name }} + + + {{ getPersonCharacter() }} + + + + + + + + + + + diff --git a/src/components/cards/MediaCard.vue b/src/components/cards/MediaCard.vue index aa1d6927..597ea37f 100644 --- a/src/components/cards/MediaCard.vue +++ b/src/components/cards/MediaCard.vue @@ -57,6 +57,15 @@ const seasonInfos = ref([]) // 选中的订阅季 const seasonsSelected = ref([]) +// 获得mediaid +function getMediaId() { + return props.media?.tmdb_id + ? `tmdb:${props.media?.tmdb_id}` + : props.media?.douban_id + ? `douban:${props.media?.douban_id}` + : `bangumi:${props.media?.bangumi_id}` +} + // 订阅弹窗选择的多季 function subscribeSeasons() { subscribeSeasonDialog.value = false @@ -131,6 +140,7 @@ async function addSubscribe(season = 0) { year: props.media?.year, tmdbid: props.media?.tmdb_id, doubanid: props.media?.douban_id, + bangumiid: props.media?.bangumi_id, season, best_version, }) @@ -186,9 +196,7 @@ async function removeSubscribe() { // 开始处理 startNProgress() try { - const mediaid = props.media?.tmdb_id - ? `tmdb:${props.media?.tmdb_id}` - : `douban:${props.media?.douban_id}` + const mediaid = getMediaId() const result: { [key: string]: any } = await api.delete( `subscribe/media/${mediaid}`, @@ -249,9 +257,7 @@ async function handleCheckExists() { // 调用API检查是否已订阅,电视剧需要指定季 async function checkSubscribe(season = 0) { try { - const mediaid = props.media?.tmdb_id - ? `tmdb:${props.media?.tmdb_id}` - : `douban:${props.media?.douban_id}` + const mediaid = getMediaId() const result: Subscribe = await api.get(`subscribe/media/${mediaid}`, { params: { @@ -362,11 +368,7 @@ function goMediaDetail() { router.push({ path: '/media', query: { - mediaid: `${ - props.media?.tmdb_id - ? `tmdb:${props.media?.tmdb_id}` - : `douban:${props.media?.douban_id}` - }`, + mediaid: getMediaId(), type: props.media?.type, }, }) @@ -377,11 +379,7 @@ function handleSearch() { router.push({ path: '/resource', query: { - keyword: `${ - props.media?.tmdb_id - ? `tmdb:${props.media?.tmdb_id}` - : `douban:${props.media?.douban_id}` - }`, + keyword: getMediaId(), type: props.media?.type, area: 'title', }, diff --git a/src/pages/ranking.vue b/src/pages/ranking.vue index b97538b9..01bea9c9 100644 --- a/src/pages/ranking.vue +++ b/src/pages/ranking.vue @@ -16,6 +16,12 @@ import MediaCardSlideView from '@/views/discover/MediaCardSlideView.vue' title="正在热映" /> + + { color="primary" /> - + @@ -492,7 +505,7 @@ onBeforeMount(() => { - + @@ -518,7 +531,7 @@ onBeforeMount(() => { - + @@ -580,6 +593,12 @@ onBeforeMount(() => { TheTvDb + + + + Bangumi + + 季 @@ -740,6 +759,33 @@ onBeforeMount(() => { + + + + + + + ID + {{ mediaDetail.bangumi_id }} + + + 原始标题 + {{ mediaDetail.original_title }} + + + 上映日期 + + {{ mediaDetail.release_date }} + + + + { type="douban" /> + + + { title="推荐" /> + + + { +