Skip to content

Commit

Permalink
Merge branch 'preview-fixes'
Browse files Browse the repository at this point in the history
  • Loading branch information
the1812 committed Oct 22, 2024
2 parents 77ada23 + 64279b6 commit 7c8d2d2
Show file tree
Hide file tree
Showing 20 changed files with 121 additions and 61 deletions.
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,58 @@
<!-- spell-checker: disable -->
# 更新日志

## v2.9.4-preview
`2024-10-22`

包含 [v2.9.4](https://github.com/the1812/Bilibili-Evolved/releases/tag/v2.9.4) 的所有更新内容.

✨新增
- 新增组件 `隐藏头像框`.
> 隐藏页面中用户的头像框 (包括角标), 目前支持动态和视频页面.
- 新增组件 `隐藏直播马赛克`. (#4634)
> 移除直播画面中的马赛克区域.
- 优化了搜索框的搜索建议精准度. (#4833)
- 新增组件 `删除动态`. (PR #4915 by [gouzil](https://github.com/gouzil))
> 删除动态, 可选转发抽奖, 和全部删除.
- `保存视频元数据` 增加 FFMETADATA 字段选项. (PR #4943 by [WakelessSloth56](https://github.com/WakelessSloth56))
- 新增组件 `评论内容替换`. (#4072)
> 替换评论中的内容.
> 可以添加多个替换配置, 每项配置可将一个关键词替换为其他文本. 若替换的目标是一个链接, 则视作替换为表情.
>
- `直播信息扩充` 更换新的 API 接口. (PR #4964 by [Oxygenくん](https://github.com/oxygenkun))

## v2.9.4
`2024-10-22`

✨新增
- `屏蔽黑名单up主` 去除了登录校验. (#4917, PR #4926 by [snowraincloud](https://github.com/snowraincloud))
- `图片批量导出` 适配新型的图片动态. (#4830)
- 更新评论区的 `夜间模式`. (#4931)

🐛修复
- 修复 StreamSaver 和 ffmpeg WASM 的 SRI 校验问题. (#4913, #4864)
- 修复下载合集时 BV 号命名重复. (#4818)
- 修复 `删除广告` 去除首页广告时没有遵循 `占位文本` 选项. (#4836)
- 修复 `自定义顶栏` 历史面板中的多余 title 提示. (#4962)
- 修复下载弹幕时播放器设置没有正确读取. (#4824)

🗑️废弃
- `自定义顶栏` 删除 `相簿` 入口.

☕开发者相关
- 修复 DevClient 无法重载 Shadow DOM 样式.

## v2.9.3-preview
`2024-09-15`

主要是各种修复, 见 [v2.9.3](https://github.com/the1812/Bilibili-Evolved/releases/tag/v2.9.3).

## v2.9.3
`2024-09-15`

<details>
<summary>正式版用户将获得 v2.9.1-preview ~ v2.9.2-preview 的所有改动, 点击展开查看</summary>
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@

> 之前的支付宝付款码有点问题, 现已弃用 (不必担心, 转账均已收到), 在爱发电中仍然可以选择支付宝作为付款方式.
<a href="https://afdian.net/@the1812" target="_blank">
<a href="https://afdian.com/a/the1812" target="_blank">
<img alt="爱发电" src="./images/compressed/afdian.jpg" width="400">
</a>

Expand Down
7 changes: 6 additions & 1 deletion doc/donate.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

## 爱发电

https://afdian.net/@the1812?tab=sponsor
https://afdian.com/a/the1812?tab=sponsor

## 微信/支付宝收款

Expand All @@ -30,6 +30,11 @@ https://afdian.net/@the1812?tab=sponsor

| 时间 | 用户名 | 单号后4位 | 金额 |
| ------------------- | --------------------- | --------- | ------- |
| 2024.10.11 11:19:52 | 匿名 | 8738 | ¥100.00 |
| 2024.09.28 22:43:29 | 匿名 | 7519 | ¥20.00 |
| 2024.09.28 17:45:29 | *| 7998 | ¥20.00 |
| 2024.09.23 14:19:17 | 匿名 | 1799 | ¥2.33 |
| 2024.09.10 00:19:41 | 匿名 | 1484 | ¥20.00 |
| 2024.09.06 16:05:23 | 匿名 | 0752 | ¥5.00 |
| 2024.09.03 23:08:43 | *| 3956 | ¥20.00 |
| 2024.08.25 16:55:07 | 匿名 | 6595 | ¥10.00 |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
},
"pnpm": {
"overrides": {
"caniuse-lite": "1.0.30001609",
"caniuse-lite": "1.0.30001668",
"consolidate": "1.0.1"
}
},
Expand Down
12 changes: 6 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { logo } from './logo/logo'
import { home } from './home/home'
import { gamesIframe, livesIframe, mangaIframe } from './iframe/iframe'
import { blanks } from './flexible-blank/flexible-blank'
import { bangumi, music, drawing, shop, match, creations } from './simple-links/simple-links'
import { bangumi, music, shop, match, creations } from './simple-links/simple-links'
import { upload } from './upload/upload'
import { search } from './search/search'
import { feeds } from './feeds/feeds'
Expand All @@ -22,7 +22,6 @@ export const getBuiltInItems = (): CustomNavbarItemInit[] => [
home,
bangumi,
ranking,
drawing,
music,
gamesIframe,
livesIframe,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
<div class="type-filters">
<div v-for="t of types" :key="t.name" class="type-filter">
<RadioButton
:title="(t.checked ? '不显示' : '显示') + t.displayName"
:class="{ checked: t.checked }"
:checked="t.checked"
:disabled="loading"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export const bangumi = getSimpleLinkItem({
displayName: '番剧',
href: 'https://www.bilibili.com/anime/',
})
export const drawing = getSimpleLinkItem({
name: 'drawing',
displayName: '相簿',
href: 'https://h.bilibili.com',
})
export const music = getSimpleLinkItem({
name: 'music',
displayName: '音频',
Expand Down
14 changes: 10 additions & 4 deletions registry/lib/components/style/dark-mode/dark-shadow-dom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@
a {
@include theme-color();
}
img,
a i {
@include to-theme('blue');
}
}
}
:host(bili-comment-box) {
Expand Down Expand Up @@ -75,3 +71,13 @@
@include border-color('3');
}
}
:host(bili-comment-renderer) {
i#note {
@include color('a');
@include background-color('3');
}
.tag:not(:empty) {
@include color('e');
@include background-color('4');
}
}
20 changes: 2 additions & 18 deletions registry/lib/components/utils/black-list/Settings.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
<template>
<div>
<div class="custom-black-list-extra-options">
<VButton
v-if="login"
ref="button"
@mouseover="loadNameBlackListSettings()"
@click="toggleNameSettings()"
>
<VButton ref="button" @mouseover="loadNameBlackListSettings()" @click="toggleNameSettings()">
精确匹配列表<VIcon icon="right-arrow" :size="16"></VIcon>
</VButton>
</div>
<div class="custom-black-list-extra-options">
<VButton
v-if="login"
ref="button"
@mouseover="loadRegexBlackListSettings()"
@click="toggleRegexSettings()"
>
<VButton @mouseover="loadRegexBlackListSettings()" @click="toggleRegexSettings()">
正则匹配列表<VIcon icon="right-arrow" :size="16"></VIcon>
</VButton>
</div>
</div>
</template>
<script lang="ts">
import { getUID } from '@/core/utils'
import { VIcon, VButton } from '@/ui'
import {
loadNameSettings,
Expand All @@ -39,11 +28,6 @@ export default Vue.extend({
VIcon,
VButton,
},
data() {
return {
login: Boolean(getUID()),
}
},
methods: {
async loadNameBlackListSettings() {
const isFirstLoad = await loadNameSettings()
Expand Down
2 changes: 1 addition & 1 deletion registry/lib/components/utils/image-exporter/feed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const setupFeedImageExporter: ComponentEntry<Options> = async ({
const imageUrls: { url: string; extension: string }[] = []
dqa(
card.element,
'.main-content .img-content, .bili-album__preview__picture__img, .bili-album .preview__picture__img',
'.main-content .img-content, .bili-album__preview__picture__img, .bili-album .preview__picture__img, .bili-dyn-gallery__image img',
).forEach((img: HTMLImageElement | HTMLDivElement) => {
const urlData = retrieveImageUrl(img)
if (urlData && !imageUrls.some(({ url }) => url === urlData.url)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,6 @@ body:not(.preserve-feed-goods) .bili-dyn-content__orig__additional:has(.dyn-good
.feed-card:has(.bili-video-card a[href*='cm.bilibili.com']),
.bili-video-card.is-rcmd:has(a[href*='cm.bilibili.com']),
.bili-video-card__wrap:has(a[href*='cm.bilibili.com']),
.bili-video-card.is-rcmd:not(:has(.bili-video-card__wrap)) {
body:not(.promotion-show-placeholder) :is(.bili-video-card.is-rcmd, .feed-card):not(:has(.bili-video-card__wrap)) {
display: none !important;
}
15 changes: 9 additions & 6 deletions registry/lib/components/video/danmaku/download/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,25 +117,25 @@ export const getUserDanmakuConfig = async () => {
})()

// 加粗
config.bold = playerAgent.getPlayerConfig('bold', false)
config.bold = playerAgent.getPlayerConfig('dmSetting.bold', false)

// 透明度
config.alpha = lodash.clamp(
1 - parseFloat(playerAgent.getPlayerConfig('opacity', '0.4')),
1 - parseFloat(playerAgent.getPlayerConfig('dmSetting.opacity', '0.4')),
0,
1,
)

// 分辨率
const resolutionFactor = 1.4 - 0.4 * playerAgent.getPlayerConfig('fontsize', 1)
const resolutionFactor = 1.4 - 0.4 * playerAgent.getPlayerConfig('dmSetting.fontsize', 1)
config.resolution = {
x: Math.round(1920 * resolutionFactor),
y: Math.round(1080 * resolutionFactor),
}

// 弹幕持续时长
config.duration = (() => {
const scrollDuration = 18 - 3 * playerAgent.getPlayerConfig('speedplus', 0)
const scrollDuration = 18 - 3 * playerAgent.getPlayerConfig('dmSetting.speedplus', 0)
return (danmaku: { type: number }) => {
switch (danmaku.type) {
case 4:
Expand All @@ -148,10 +148,13 @@ export const getUserDanmakuConfig = async () => {
})()

// 底部间距
const bottomMargin = playerAgent.getPlayerConfig('danmakuArea', 0)
const bottomMargin = playerAgent.getPlayerConfig('dmSetting.danmakuArea', 0)
config.bottomMarginPercent = bottomMargin >= 100 ? 0 : bottomMargin / 100
// 无显示区域限制时要检查是否开启防挡字幕
if (config.bottomMarginPercent === 0 && playerAgent.getPlayerConfig('preventshade', false)) {
if (
config.bottomMarginPercent === 0 &&
playerAgent.getPlayerConfig('dmSetting.preventshade', false)
) {
config.bottomMarginPercent = 0.15
}

Expand Down
2 changes: 2 additions & 0 deletions registry/lib/components/video/download/inputs/video/batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ export const videoSeasonBatchInput: DownloadVideoInput = {
n: formatNumber(page, totalEpisodesLength),
title: episode.page.part,
cid: episode.cid,
aid: episode.aid,
bvid: episode.bvid,
ep: episode.title,
user: owner.name,
userID: owner.mid?.toString(),
Expand Down
24 changes: 17 additions & 7 deletions registry/lib/components/video/player/show-upload-time/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Vue from 'vue'
import { defineComponentMetadata } from '@/components/define'
import { urlChange } from '@/core/observer'
import { playerReady, getVue2Data } from '@/core/utils'
Expand Down Expand Up @@ -118,6 +119,8 @@ export const component = defineComponentMetadata({
formatString = options.formatString?.toString()
}
relist.forEach(async video => {
// 使用临时变量保存视频名称,以避免计算属性导致的问题
let videoName: string = video.name
// 确认存放推荐视频列表的List中的元素是否被更新
if (forceUpdate || !video.item.owner.mark) {
video.item.owner.mark = true
Expand All @@ -134,16 +137,21 @@ export const component = defineComponentMetadata({
if (!video.oldname) {
video.oldname = video.name
}
video.name = getFormatStr(createTime, formatString, video.oldname)
videoName = getFormatStr(createTime, formatString, video.oldname)
video.name = videoName
}
// 保存生成后的name
video.item.owner.name = video.name
video.item.owner.name = videoName
}
})
}

const getRecoList = () => {
const reco_list = dq('#reco_list')
let reco_list = dq('#reco_list')
// 2024.10.17 兼容最近的b站前端改动
if (reco_list == null) {
reco_list = dq('.recommend-list-v1')
}
let recoList: RecommendList = getVue2Data(reco_list)
if (recoList.isOpen === undefined) {
recoList = recoList.$children[0]
Expand All @@ -156,12 +164,14 @@ export const component = defineComponentMetadata({
return recoList
}

const videoClasses = ['video-page-operator-card-small', 'video-page-card-small']

addComponentListener(
`${metadata.name}.formatString`,
(value: string) => {
const recoList: RecommendList = getRecoList()
const relist: VideoPageCard[] = recoList.$children.filter(
video => video.$el.className.indexOf('special') === -1,
const relist: VideoPageCard[] = recoList.$children.filter(video =>
videoClasses.includes(video.$el.className),
)
showUploadTime(relist, true, value)
},
Expand All @@ -180,8 +190,8 @@ export const component = defineComponentMetadata({
'recListItems',
() => {
console.debug('recoListItems changed, now url is', document.URL)
const relist = recoList.$children.filter(
video => video.$el.className.indexOf('special') === -1,
const relist = recoList.$children.filter(video =>
videoClasses.includes(video.$el.className),
)
showUploadTime(relist)
},
Expand Down
Loading

0 comments on commit 7c8d2d2

Please sign in to comment.