mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
parent
5bf1ef1450
commit
d94b85eceb
@ -102,9 +102,18 @@ export interface EpisodeInfo {
|
||||
skip: {
|
||||
[x in 'ed' | 'op']: { start: number; end: number }
|
||||
}
|
||||
section: string
|
||||
info?: VideoInfo
|
||||
}
|
||||
|
||||
/**
|
||||
* @author WakelessSloth56
|
||||
*/
|
||||
export interface SectionInfo {
|
||||
title: string
|
||||
episodes: EpisodeInfo[]
|
||||
}
|
||||
|
||||
/**
|
||||
* @author WakelessSloth56, LainIO24
|
||||
*/
|
||||
@ -127,8 +136,12 @@ export class BangumiInfo {
|
||||
isFinish: boolean
|
||||
isStarted: boolean
|
||||
styles: string[]
|
||||
/** 通过 {@link BangumiInfo.byEpisodeId()} 指定的 `epid` 对应的集,若通过 {@link BangumiInfo.bySeasonId()} 则不存在 */
|
||||
episode?: EpisodeInfo
|
||||
/** 包含正片及花絮、PV、番外等非正片内容 */
|
||||
episodes: EpisodeInfo[]
|
||||
/** 花絮、PV、番外等非正片内容 */
|
||||
sections?: SectionInfo[]
|
||||
/** @deprecated use {@link BangumiInfo.episodes} instead */
|
||||
videos: {
|
||||
title: string
|
||||
@ -171,7 +184,23 @@ export class BangumiInfo {
|
||||
this.isStarted = data.publish.is_started === 1
|
||||
this.styles = data.styles
|
||||
this.areas = data.areas
|
||||
this.episodes = data.episodes.map(x => {
|
||||
this.sections = data.section
|
||||
const episodes = [
|
||||
...data.episodes.map((ep: EpisodeInfo) => {
|
||||
ep.section = data.positive.title
|
||||
return ep
|
||||
}),
|
||||
...(data.section ?? [])
|
||||
.flatMap((x: SectionInfo) => {
|
||||
return x.episodes.map((ep: EpisodeInfo) => {
|
||||
ep.section = x.title
|
||||
return ep
|
||||
})
|
||||
})
|
||||
// 有些内容(例如次元发电机专访)是链接,cid、aid等为0
|
||||
.filter(x => x.cid > 0),
|
||||
]
|
||||
this.episodes = episodes.map(x => {
|
||||
const r: EpisodeInfo = {
|
||||
aid: x.aid,
|
||||
bvid: x.bvid,
|
||||
@ -181,6 +210,7 @@ export class BangumiInfo {
|
||||
cover: x.cover,
|
||||
duration: x.duration / 1000,
|
||||
skip: x.skip,
|
||||
section: x.section,
|
||||
}
|
||||
if (r.epid === this.epid) {
|
||||
this.episode = r
|
||||
|
||||
Loading…
Reference in New Issue
Block a user