mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Update timeline API (fix #3552)
This commit is contained in:
parent
18d959c849
commit
169725de9f
@ -37,12 +37,10 @@ import { RankListCard } from './rank-list'
|
||||
|
||||
const bangumiDataMap = {
|
||||
anime: {
|
||||
timeline: 'global',
|
||||
seasonType: 1,
|
||||
rankingName: 'bangumi',
|
||||
},
|
||||
guochuang: {
|
||||
timeline: 'cn',
|
||||
seasonType: 4,
|
||||
// 你永远不知道"国创"在 b 站代码里有多少种叫法...
|
||||
rankingName: 'guochan',
|
||||
@ -62,11 +60,11 @@ export default Vue.extend({
|
||||
},
|
||||
data() {
|
||||
const { route } = this.region.category
|
||||
const { rankingName, seasonType, timeline } = bangumiDataMap[route]
|
||||
const { rankingName, seasonType } = bangumiDataMap[route]
|
||||
return {
|
||||
bangumiDataMap,
|
||||
route,
|
||||
timelineApi: `https://bangumi.bilibili.com/web_api/timeline_${timeline}`,
|
||||
timelineApi: `https://api.bilibili.com/pgc/web/timeline?types=${seasonType}&before=6&after=6`,
|
||||
rankingsApi: `https://api.bilibili.com/pgc/season/rank/web/list?day=3&season_type=${seasonType}`,
|
||||
rankingsLink: `https://www.bilibili.com/v/popular/rank/${rankingName}`,
|
||||
}
|
||||
|
||||
@ -35,15 +35,15 @@
|
||||
<div
|
||||
ref="seasonsList"
|
||||
class="fresh-home-categories-bangumi-timeline-seasons-container scroll-top scroll-bottom"
|
||||
:class="{ 'not-empty': item.seasons.length > 0 }"
|
||||
:class="{ 'not-empty': item.episodes.length > 0 }"
|
||||
>
|
||||
<div
|
||||
class="fresh-home-categories-bangumi-timeline-seasons"
|
||||
:class="{ today: index === todayIndex }"
|
||||
>
|
||||
<VEmpty v-if="item.seasons.length === 0" />
|
||||
<VEmpty v-if="item.episodes.length === 0" />
|
||||
<a
|
||||
v-for="season of item.seasons"
|
||||
v-for="season of item.episodes"
|
||||
:key="season.season_id"
|
||||
:data-season="season.season_id"
|
||||
class="fresh-home-categories-bangumi-timeline-season"
|
||||
@ -137,7 +137,7 @@ interface TimelineDay {
|
||||
date_ts: number
|
||||
day_of_week: number
|
||||
is_today: number
|
||||
seasons: TimelineSeason[]
|
||||
episodes: TimelineSeason[]
|
||||
}
|
||||
|
||||
const rankListHeight = rankListCssVars.panelHeight - 2 * rankListCssVars.padding
|
||||
@ -256,7 +256,7 @@ export default Vue.extend({
|
||||
if (!todaySeasons) {
|
||||
return
|
||||
}
|
||||
const seasonsData: TimelineSeason[] = this.items[this.todayIndex]?.seasons
|
||||
const seasonsData: TimelineSeason[] = this.items[this.todayIndex]?.episodes
|
||||
if (seasonsData.length === 0) {
|
||||
return
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user