mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Filter pre-order videos (fix #1682)
This commit is contained in:
parent
3f959e029b
commit
404de5d867
2
min/custom-navbar-activities.min.js
vendored
2
min/custom-navbar-activities.min.js
vendored
File diff suppressed because one or more lines are too long
2
min/feeds-apis.min.js
vendored
2
min/feeds-apis.min.js
vendored
File diff suppressed because one or more lines are too long
@ -414,6 +414,9 @@ export const isVideoCardBlocked = (card: Pick<VideoCardInfo, 'title' | 'dynamic'
|
||||
username: card.upName,
|
||||
})
|
||||
}
|
||||
export const isPreOrderedVideo = (card: any) => {
|
||||
return _.get(card, 'extra.is_reserve_recall', 0) === 1
|
||||
}
|
||||
|
||||
export const getVideoFeeds = async (type: 'video' | 'bangumi' = 'video'): Promise<VideoCardInfo[]> => {
|
||||
if (!getUID()) {
|
||||
@ -557,5 +560,6 @@ export default {
|
||||
addMenuItem,
|
||||
isCardBlocked,
|
||||
isVideoCardBlocked,
|
||||
isPreOrderedVideo,
|
||||
},
|
||||
}
|
||||
|
||||
@ -163,7 +163,7 @@ export class Activities extends NavbarComponent {
|
||||
this.setNotifyCount(json.data.update_num)
|
||||
}
|
||||
async init() {
|
||||
const { isVideoCardBlocked, isCardBlocked } = await import('../../../activity/feeds-apis')
|
||||
const { isVideoCardBlocked, isCardBlocked, isPreOrderedVideo } = await import('../../../activity/feeds-apis')
|
||||
Vue.component('activity-loading', {
|
||||
template: /*html*/`
|
||||
<div v-if="loading" class="loading">
|
||||
@ -419,18 +419,20 @@ export class Activities extends NavbarComponent {
|
||||
</div>
|
||||
`,
|
||||
handleJson: async function (json) {
|
||||
const cards = _.get<any[]>(json, 'data.cards', []).map((card: any) => {
|
||||
const cardJson = JSON.parse(card.card)
|
||||
return {
|
||||
title: cardJson.apiSeasonInfo.title,
|
||||
coverUrl: cardJson.apiSeasonInfo.cover,
|
||||
epCoverUrl: cardJson.cover,
|
||||
epTitle: cardJson.new_desc,
|
||||
url: cardJson.url,
|
||||
id: card.desc.dynamic_id_str,
|
||||
get new() { return Activities.isNewID(this.id) },
|
||||
}
|
||||
})
|
||||
const cards = _.get<any[]>(json, 'data.cards', [])
|
||||
.filter((card: any) => !isPreOrderedVideo(card))
|
||||
.map((card: any) => {
|
||||
const cardJson = JSON.parse(card.card)
|
||||
return {
|
||||
title: cardJson.apiSeasonInfo.title,
|
||||
coverUrl: cardJson.apiSeasonInfo.cover,
|
||||
epCoverUrl: cardJson.cover,
|
||||
epTitle: cardJson.new_desc,
|
||||
url: cardJson.url,
|
||||
id: card.desc.dynamic_id_str,
|
||||
get new() { return Activities.isNewID(this.id) },
|
||||
}
|
||||
})
|
||||
this.cards = _.uniqBy(cards.concat(this.cards), it => it.id)
|
||||
.sort((a, b) => {
|
||||
return b.id > a.id ? 1 : -1
|
||||
@ -482,21 +484,23 @@ export class Activities extends NavbarComponent {
|
||||
</div>
|
||||
`,
|
||||
handleJson: async function (json) {
|
||||
const cards = _.get<any[]>(json, 'data.cards', []).map((card: any) => {
|
||||
const cardJson = JSON.parse(card.card)
|
||||
return {
|
||||
covers: cardJson.image_urls,
|
||||
originalCovers: cardJson.origin_image_urls,
|
||||
upName: cardJson.author.name,
|
||||
faceUrl: cardJson.author.face,
|
||||
upUrl: `https://space.bilibili.com/${cardJson.author.mid}`,
|
||||
title: cardJson.title,
|
||||
description: cardJson.summary,
|
||||
url: `https://www.bilibili.com/read/cv${cardJson.id}`,
|
||||
id: card.desc.dynamic_id_str,
|
||||
get new() { return Activities.isNewID(this.id) },
|
||||
}
|
||||
})
|
||||
const cards = _.get<any[]>(json, 'data.cards', [])
|
||||
.filter((card: any) => !isPreOrderedVideo(card))
|
||||
.map((card: any) => {
|
||||
const cardJson = JSON.parse(card.card)
|
||||
return {
|
||||
covers: cardJson.image_urls,
|
||||
originalCovers: cardJson.origin_image_urls,
|
||||
upName: cardJson.author.name,
|
||||
faceUrl: cardJson.author.face,
|
||||
upUrl: `https://space.bilibili.com/${cardJson.author.mid}`,
|
||||
title: cardJson.title,
|
||||
description: cardJson.summary,
|
||||
url: `https://www.bilibili.com/read/cv${cardJson.id}`,
|
||||
id: card.desc.dynamic_id_str,
|
||||
get new() { return Activities.isNewID(this.id) },
|
||||
}
|
||||
})
|
||||
this.cards = _.uniqBy(cards.concat(this.cards), it => it.id)
|
||||
.sort((a, b) => {
|
||||
return b.id > a.id ? 1 : -1
|
||||
|
||||
Loading…
Reference in New Issue
Block a user