mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Update feeds card types (#5135)
This commit is contained in:
parent
a4a4c066c2
commit
e556982770
@ -146,7 +146,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
this.allTypes = Object.entries(feedsCardTypes)
|
this.allTypes = Object.entries(feedsCardTypes)
|
||||||
.concat(Object.entries(specialTypes))
|
.concat(Object.entries(specialTypes))
|
||||||
.filter(([, type]) => type.id <= 2048)
|
.filter(([, type]) => type.id <= 2048 && type.id > 0)
|
||||||
.map(([name, type]) => [name, lodash.clone(type)])
|
.map(([name, type]) => [name, lodash.clone(type)])
|
||||||
cardsManager = await forEachFeedsCard({
|
cardsManager = await forEachFeedsCard({
|
||||||
added: card => {
|
added: card => {
|
||||||
|
|||||||
@ -15,6 +15,12 @@ const feedsCardTypeMap = {
|
|||||||
DynamicTypeArticle: feedsCardTypes.column,
|
DynamicTypeArticle: feedsCardTypes.column,
|
||||||
DynamicTypeMusic: feedsCardTypes.audio,
|
DynamicTypeMusic: feedsCardTypes.audio,
|
||||||
DynamicTypeLiveRcmd: feedsCardTypes.liveRecord,
|
DynamicTypeLiveRcmd: feedsCardTypes.liveRecord,
|
||||||
|
DynamicTypeCourses: feedsCardTypes.courses,
|
||||||
|
DynamicTypeOpus: feedsCardTypes.textWithImages,
|
||||||
|
DynamicTypeLive: feedsCardTypes.live,
|
||||||
|
DynamicTypeMedialist: feedsCardTypes.mediaList,
|
||||||
|
DynamicTypeSubscription: feedsCardTypes.mediaList,
|
||||||
|
DynamicTypeUgcSeason: feedsCardTypes.ugcSeason,
|
||||||
}
|
}
|
||||||
|
|
||||||
const combineText = (...texts: string[]) =>
|
const combineText = (...texts: string[]) =>
|
||||||
@ -23,7 +29,7 @@ const combineText = (...texts: string[]) =>
|
|||||||
.join('\n')
|
.join('\n')
|
||||||
.trim()
|
.trim()
|
||||||
const getType = (rawType: string): FeedsCardType =>
|
const getType = (rawType: string): FeedsCardType =>
|
||||||
feedsCardTypeMap[pascalCase(rawType)] ?? feedsCardTypeMap.DynamicTypeWord
|
feedsCardTypeMap[pascalCase(rawType)] ?? feedsCardTypes.unknown
|
||||||
const getText = (dynamicModule: any, cardType: FeedsCardType) => {
|
const getText = (dynamicModule: any, cardType: FeedsCardType) => {
|
||||||
const isOpusModule = Object.hasOwn(dynamicModule, 'paragraphs')
|
const isOpusModule = Object.hasOwn(dynamicModule, 'paragraphs')
|
||||||
if (isOpusModule) {
|
if (isOpusModule) {
|
||||||
|
|||||||
@ -15,6 +15,10 @@ export interface RepostFeedsCardType extends FeedsCardType {
|
|||||||
name: '转发'
|
name: '转发'
|
||||||
}
|
}
|
||||||
export const feedsCardTypes = {
|
export const feedsCardTypes = {
|
||||||
|
unknown: {
|
||||||
|
id: 0,
|
||||||
|
name: '未知',
|
||||||
|
},
|
||||||
repost: {
|
repost: {
|
||||||
id: 1,
|
id: 1,
|
||||||
name: '转发',
|
name: '转发',
|
||||||
@ -78,8 +82,20 @@ export const feedsCardTypes = {
|
|||||||
id: 4300,
|
id: 4300,
|
||||||
name: '收藏夹',
|
name: '收藏夹',
|
||||||
},
|
},
|
||||||
|
courses: {
|
||||||
|
id: 2044,
|
||||||
|
name: '课程',
|
||||||
|
},
|
||||||
|
live: {
|
||||||
|
id: 2045,
|
||||||
|
name: '直播',
|
||||||
|
},
|
||||||
|
ugcSeason: {
|
||||||
|
id: 2046,
|
||||||
|
name: '合集',
|
||||||
|
},
|
||||||
liveRecord: {
|
liveRecord: {
|
||||||
id: 2047, // FIXME: 暂时随便写个 id 了, 这个东西目前找不到 type
|
id: 2047,
|
||||||
name: '开播记录',
|
name: '开播记录',
|
||||||
},
|
},
|
||||||
} satisfies Record<string, FeedsCardType>
|
} satisfies Record<string, FeedsCardType>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user