diff --git a/README.md b/README.md index 69e6dc914..c553d2183 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ 不兼容. ### [AdGuard](https://adguard.com/zh_cn/adguard-windows/overview.html) -未测试. +不兼容. ## 浏览器 diff --git a/registry/lib/components/live/gift-box/gift-box.scss b/registry/lib/components/live/gift-box/gift-box.scss index f276736d4..4437b0570 100644 --- a/registry/lib/components/live/gift-box/gift-box.scss +++ b/registry/lib/components/live/gift-box/gift-box.scss @@ -54,3 +54,23 @@ } } } + +.new-silver-wallet { + background-color: var(--Ga1_u) !important; +} + +.new-list-box * .num > span { + color: var(--text3) !important; +} + +.click-root > .content-box { + color: #000 !important; + > .text { + color: #000 !important; + } +} + +.new-list-box * .static-bg-root { + --static-bg-color: #ffecf1 !important; + --static-bg-border-color: #ff6699 !important; +} diff --git a/registry/lib/components/style/custom-navbar/favorites/NavbarFavorites.vue b/registry/lib/components/style/custom-navbar/favorites/NavbarFavorites.vue index 3e2366b96..de6905962 100644 --- a/registry/lib/components/style/custom-navbar/favorites/NavbarFavorites.vue +++ b/registry/lib/components/style/custom-navbar/favorites/NavbarFavorites.vue @@ -22,7 +22,7 @@
@@ -376,7 +376,7 @@ export default Vue.extend({ &:hover .cover { transform: scale(1.05); } - .cover-container { + .favorites-cover-container { grid-area: cover; overflow: hidden; border-radius: 8px 0 0 8px; diff --git a/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue b/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue index 43aa0813b..c2042fb00 100644 --- a/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue +++ b/registry/lib/components/style/custom-navbar/history/NavbarHistory.vue @@ -48,7 +48,7 @@
- + -
+
@@ -186,7 +186,7 @@ export default Vue.extend({ background-color: #2d2d2d; color: #eee; } - .cover-container { + .subscriptions-cover-container { height: 64px; width: 64px; border-radius: $radius 0 0 $radius; diff --git a/registry/lib/components/style/custom-navbar/watchlater/NavbarWatchlater.vue b/registry/lib/components/style/custom-navbar/watchlater/NavbarWatchlater.vue index 7e520793c..f4f3540e2 100644 --- a/registry/lib/components/style/custom-navbar/watchlater/NavbarWatchlater.vue +++ b/registry/lib/components/style/custom-navbar/watchlater/NavbarWatchlater.vue @@ -24,7 +24,7 @@
- + => { const { SubtitleConverter, SubtitleSize, SubtitleLocation } = await import( @@ -64,11 +75,10 @@ export const getSubtitleConfig = async (): Promise<[SubtitleConverterConfig, str return [config, language] } export const getSubtitleList = async (aid: string, cid: string | number) => { - const { VideoInfo } = await import('@/components/video/video-info') - const info = new VideoInfo(aid) - info.cid = typeof cid === 'string' ? parseInt(cid) : cid - await info.fetchInfo() - return info.subtitles + const data = await bilibiliApi( + getJsonWithCredentials(`https://api.bilibili.com/x/player/wbi/v2?aid=${aid}&cid=${cid}`), + ) + return lodash.get(data, 'subtitle.subtitles', []) as SubtitleInfo[] } export const getBlobByType = async ( type: SubtitleDownloadType, @@ -88,8 +98,8 @@ export const getBlobByType = async ( return null } const [config, language] = await getSubtitleConfig() - const subtitle = subtitles.find(s => s.languageCode === language) || subtitles[0] - const json = await getJson(subtitle.url) + const subtitle = subtitles.find(s => s.lan === language) || subtitles[0] + const json = await getJson(subtitle.subtitle_url) const rawData = json.body switch (type) { case 'ass': { @@ -102,7 +112,7 @@ export const getBlobByType = async ( } default: case 'json': { - return new Blob([JSON.stringify(rawData)], { + return new Blob([JSON.stringify(rawData, undefined, 2)], { type: 'text/json', }) } diff --git a/src/components/launch-bar/ActionItem.vue b/src/components/launch-bar/ActionItem.vue index 4d98f0113..962b0cf12 100644 --- a/src/components/launch-bar/ActionItem.vue +++ b/src/components/launch-bar/ActionItem.vue @@ -7,8 +7,8 @@ @click.self="performAction($event)" @keydown.enter.prevent.stop="performAction($event)" @keydown.shift.delete.prevent.stop="performDelete($event)" - @keydown.up.prevent.stop="$emit('previous-item', $event)" - @keydown.down.prevent.stop="$emit('next-item', $event)" + @keydown.up.prevent.stop="$emit('previous-item', $event.currentTarget)" + @keydown.down.prevent.stop="$emit('next-item', $event.currentTarget)" >
@@ -54,15 +54,17 @@ export default Vue.extend({ }, methods: { async performAction(event: KeyboardEvent | MouseEvent) { + const { currentTarget } = event await this.action.action() - this.$emit('action', event) + this.$emit('action', currentTarget) }, async performDelete(event: KeyboardEvent | MouseEvent) { + const { currentTarget } = event if (!this.action.deleteAction) { return } await this.action.deleteAction() - this.$emit('delete-item', event) + this.$emit('delete-item', currentTarget) }, }, }) diff --git a/src/components/launch-bar/LaunchBar.vue b/src/components/launch-bar/LaunchBar.vue index 7e7213e0f..91f415db3 100644 --- a/src/components/launch-bar/LaunchBar.vue +++ b/src/components/launch-bar/LaunchBar.vue @@ -221,24 +221,24 @@ export default Vue.extend({ this.$refs.list.querySelector('.suggest-item').focus() e.preventDefault() }, - previousItem(e: KeyboardEvent, index: number) { + previousItem(element: HTMLElement, index: number) { if (index === 0) { this.focus() } else { - ;((e.currentTarget as HTMLElement).previousElementSibling as HTMLElement).focus() + ;(element.previousElementSibling as HTMLElement).focus() } }, - nextItem(e: KeyboardEvent, index: number) { + nextItem(element: HTMLElement, index: number) { const lastItemIndex = this.actions.length - 1 if (index !== lastItemIndex) { - ;((e.currentTarget as HTMLElement).nextElementSibling as HTMLElement).focus() + ;(element.nextElementSibling as HTMLElement).focus() } else { this.focus() } }, search, - onDeleteItem(e: Event, index: number) { - this.previousItem(e, index) + onDeleteItem(element: HTMLElement, index: number) { + this.previousItem(element, index) this.getActions() }, onClearHistory() { diff --git a/src/components/video/video-info.ts b/src/components/video/video-info.ts index d14e906cd..af1bb7400 100644 --- a/src/components/video/video-info.ts +++ b/src/components/video/video-info.ts @@ -21,12 +21,6 @@ export class VideoInfo { title: string pageNumber: number }[] - subtitles: { - id: number - languageCode: string - language: string - url: string - }[] constructor(id: string, bvid = false) { if (bvid) { @@ -70,15 +64,20 @@ export class VideoInfo { title: it.part, pageNumber: it.page, })) - this.subtitles = - data.subtitle?.list?.map((it: any) => ({ - id: it.id, - languageCode: it.lan, - language: it.lan_doc, - url: it.subtitle_url.replace('http:', 'https:'), - })) ?? [] return this } + + /** @deprecated */ + // eslint-disable-next-line class-methods-use-this + get subtitles(): { + id: number + languageCode: string + language: string + url: string + }[] { + console.warn('VideoInfo.subtitles is deprecated') + return [] + } } export class BangumiInfo { ep: number