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)
|
||||
.concat(Object.entries(specialTypes))
|
||||
.filter(([, type]) => type.id <= 2048)
|
||||
.filter(([, type]) => type.id <= 2048 && type.id > 0)
|
||||
.map(([name, type]) => [name, lodash.clone(type)])
|
||||
cardsManager = await forEachFeedsCard({
|
||||
added: card => {
|
||||
|
||||
@ -15,6 +15,12 @@ const feedsCardTypeMap = {
|
||||
DynamicTypeArticle: feedsCardTypes.column,
|
||||
DynamicTypeMusic: feedsCardTypes.audio,
|
||||
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[]) =>
|
||||
@ -23,7 +29,7 @@ const combineText = (...texts: string[]) =>
|
||||
.join('\n')
|
||||
.trim()
|
||||
const getType = (rawType: string): FeedsCardType =>
|
||||
feedsCardTypeMap[pascalCase(rawType)] ?? feedsCardTypeMap.DynamicTypeWord
|
||||
feedsCardTypeMap[pascalCase(rawType)] ?? feedsCardTypes.unknown
|
||||
const getText = (dynamicModule: any, cardType: FeedsCardType) => {
|
||||
const isOpusModule = Object.hasOwn(dynamicModule, 'paragraphs')
|
||||
if (isOpusModule) {
|
||||
|
||||
@ -15,6 +15,10 @@ export interface RepostFeedsCardType extends FeedsCardType {
|
||||
name: '转发'
|
||||
}
|
||||
export const feedsCardTypes = {
|
||||
unknown: {
|
||||
id: 0,
|
||||
name: '未知',
|
||||
},
|
||||
repost: {
|
||||
id: 1,
|
||||
name: '转发',
|
||||
@ -78,8 +82,20 @@ export const feedsCardTypes = {
|
||||
id: 4300,
|
||||
name: '收藏夹',
|
||||
},
|
||||
courses: {
|
||||
id: 2044,
|
||||
name: '课程',
|
||||
},
|
||||
live: {
|
||||
id: 2045,
|
||||
name: '直播',
|
||||
},
|
||||
ugcSeason: {
|
||||
id: 2046,
|
||||
name: '合集',
|
||||
},
|
||||
liveRecord: {
|
||||
id: 2047, // FIXME: 暂时随便写个 id 了, 这个东西目前找不到 type
|
||||
id: 2047,
|
||||
name: '开播记录',
|
||||
},
|
||||
} satisfies Record<string, FeedsCardType>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user