Skip to content

Commit 5477b4a

Browse files
committed
fix: unable to uncheck the source of dandanplay
1 parent 0ee5657 commit 5477b4a

File tree

4 files changed

+16
-18
lines changed

4 files changed

+16
-18
lines changed

electron-builder.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,4 @@ releaseInfo:
7777
修复重置 App 后字幕无法加载
7878
修复弹幕来源取消勾选后,下次播放视频无法生效的问题
7979
添加加载字幕提示
80+
修复无法取消勾选弹弹play来源

src/renderer/src/components/modules/player/loading/hooks.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,20 @@ export const useDanmakuData = () => {
210210
const historyDanmaku = history?.danmaku?.find((item) => item.source === related.url)
211211

212212
const handleIsSelected = () => {
213-
// 如果历史记录中有选中的弹幕库,就返回 true
214-
213+
// bilibili 弹幕库感觉有重复的弹幕,目前只默认加载一个 bilibili 弹幕库
215214
if (related.url.includes('bilibili')) {
216215
return (
217216
related.url ===
218217
thirdPartyDanmakuUrlData?.find((item) => item.url.includes('bilibili'))?.url
219218
)
220219
}
221-
return historyDanmaku?.selected
222-
223-
// bilibili 弹幕库感觉有重复的弹幕,目前只默认加载一个 bilibili 弹幕库
220+
return true
224221
}
225222
// 使用弹幕缓存
226223
if (historyDanmaku && !history?.newBangumi) {
227224
return {
228225
...historyDanmaku?.content,
229-
selected: handleIsSelected(),
226+
selected: historyDanmaku?.selected,
230227
}
231228
}
232229
const fetchData = await apiClient.comment.getExtcomment({ url: related.url })

src/renderer/src/components/modules/player/setting/items/subtitle/SubtitleImport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ export const SubtitleImport = () => {
132132
{isWeb && (
133133
<input
134134
type="file"
135-
accept=".ass, .ssa, .art, .vtt"
135+
accept=".ass, .ssa"
136136
ref={fileInputRef}
137137
onChange={importSubtitleFromBrowser}
138138
className="hidden"

src/renderer/src/components/modules/settings/views/player/VideoSetting.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,19 @@ import { FieldLayout, FieldsCardLayout } from '../Layout'
66

77
export const VideoSetting = () => {
88
const [playerSetting, setPlayerSetting] = usePlayerSettings()
9-
if (isWeb) {
10-
return
11-
}
9+
1210
return (
1311
<FieldsCardLayout title="视频">
14-
<FieldLayout title="自动续播">
15-
<SettingSwitch
16-
value={playerSetting.enableAutomaticEpisodeSwitching}
17-
onCheckedChange={(value) => {
18-
setPlayerSetting((prev) => ({ ...prev, enableAutomaticEpisodeSwitching: value }))
19-
}}
20-
/>
21-
</FieldLayout>
12+
{!isWeb && (
13+
<FieldLayout title="自动续播">
14+
<SettingSwitch
15+
value={playerSetting.enableAutomaticEpisodeSwitching}
16+
onCheckedChange={(value) => {
17+
setPlayerSetting((prev) => ({ ...prev, enableAutomaticEpisodeSwitching: value }))
18+
}}
19+
/>
20+
</FieldLayout>
21+
)}
2222

2323
<FieldLayout title="底部迷你进度条">
2424
<SettingSwitch

0 commit comments

Comments
 (0)