From 655b4389b73a72d5b29961aba3c1f3c756d3630e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E1=B4=80=E1=B4=8D=E1=B4=9B=E1=B4=8F=E1=B4=80=E1=B4=87?= =?UTF-8?q?=CA=80?= Date: Thu, 10 Jul 2025 01:46:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=20"=E5=9C=A8=20b=20?= =?UTF-8?q?=E7=AB=99=E6=89=93=E5=BC=80"=20=E7=9A=84=E5=BF=AB=E6=8D=B7?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=EF=BC=8C=E4=B8=80=E4=BA=9B=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E4=BC=98=E5=8C=96=20(#384)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/bili_sync/src/api/response.rs | 1 + web/src/lib/components/app-sidebar.svelte | 6 +-- web/src/lib/components/video-card.svelte | 50 ++++++++++++++++------ web/src/lib/types.ts | 1 + web/src/routes/me/collections/+page.svelte | 2 +- web/src/routes/me/favorites/+page.svelte | 2 +- web/src/routes/me/uppers/+page.svelte | 9 +++- web/src/routes/video/[id]/+page.svelte | 13 ++++++ web/src/routes/videos/+page.svelte | 4 +- 9 files changed, 66 insertions(+), 22 deletions(-) diff --git a/crates/bili_sync/src/api/response.rs b/crates/bili_sync/src/api/response.rs index 21bf036..65e4816 100644 --- a/crates/bili_sync/src/api/response.rs +++ b/crates/bili_sync/src/api/response.rs @@ -55,6 +55,7 @@ pub struct VideoSource { #[sea_orm(entity = "video::Entity")] pub struct VideoInfo { pub id: i32, + pub bvid: String, pub name: String, pub upper_name: String, #[serde(serialize_with = "serde_video_download_status")] diff --git a/web/src/lib/components/app-sidebar.svelte b/web/src/lib/components/app-sidebar.svelte index f32e8ee..0764261 100644 --- a/web/src/lib/components/app-sidebar.svelte +++ b/web/src/lib/components/app-sidebar.svelte @@ -54,17 +54,17 @@ category: '快捷订阅', items: [ { - title: '收藏夹', + title: '我创建的收藏夹', icon: HeartIcon, href: '/me/favorites' }, { - title: '合集', + title: '我关注的合集', icon: FolderIcon, href: '/me/collections' }, { - title: 'up 主', + title: '我关注的 up 主', icon: UserIcon, href: '/me/uppers' } diff --git a/web/src/lib/components/video-card.svelte b/web/src/lib/components/video-card.svelte index 520c35c..a53c9f7 100644 --- a/web/src/lib/components/video-card.svelte +++ b/web/src/lib/components/video-card.svelte @@ -3,10 +3,13 @@ import { Card, CardContent, CardHeader, CardTitle } from '$lib/components/ui/card/index.js'; import { Button } from '$lib/components/ui/button/index.js'; import * as AlertDialog from '$lib/components/ui/alert-dialog/index.js'; + import * as DropdownMenu from '$lib/components/ui/dropdown-menu/index.js'; import type { VideoInfo } from '$lib/types'; import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw'; import InfoIcon from '@lucide/svelte/icons/info'; import UserIcon from '@lucide/svelte/icons/user'; + import SquareArrowOutUpRightIcon from '@lucide/svelte/icons/square-arrow-out-up-right'; + import MoreHorizontalIcon from '@lucide/svelte/icons/more-horizontal'; import { goto } from '$app/navigation'; import * as Tooltip from '$lib/components/ui/tooltip/index.js'; @@ -124,7 +127,7 @@ {#if showProgress}
-
+
下载进度 {completed}/{total}
@@ -140,7 +143,7 @@ >
-

{getTaskName(index)}: {getStatusText(status)}

+

{getTaskName(index)}: {getStatusText(status)}

{/each} @@ -149,24 +152,45 @@ {/if} {#if showActions && mode === 'default'} -
+
- + + + + {#snippet child({ props })} + + {/snippet} + + + + window.open(`https://www.bilibili.com/video/${video.bvid}/`, '_blank')} + > + + 在 B 站打开 + + (resetDialogOpen = true)}> + + 重置下载状态 + + +
{/if}
diff --git a/web/src/lib/types.ts b/web/src/lib/types.ts index 5e0f867..6d52b38 100644 --- a/web/src/lib/types.ts +++ b/web/src/lib/types.ts @@ -33,6 +33,7 @@ export interface VideoSourcesResponse { // 视频信息类型 export interface VideoInfo { id: number; + bvid: string; name: string; upper_name: string; download_status: [number, number, number, number, number]; diff --git a/web/src/routes/me/collections/+page.svelte b/web/src/routes/me/collections/+page.svelte index 06f98b3..01b3a4f 100644 --- a/web/src/routes/me/collections/+page.svelte +++ b/web/src/routes/me/collections/+page.svelte @@ -58,7 +58,7 @@
-
+
{#if !loading} 共 {totalCount} 个合集 {/if} diff --git a/web/src/routes/me/favorites/+page.svelte b/web/src/routes/me/favorites/+page.svelte index e48bd8d..eea632b 100644 --- a/web/src/routes/me/favorites/+page.svelte +++ b/web/src/routes/me/favorites/+page.svelte @@ -44,7 +44,7 @@
-
+
{#if !loading} 共 {favorites.length} 个收藏夹 {/if} diff --git a/web/src/routes/me/uppers/+page.svelte b/web/src/routes/me/uppers/+page.svelte index b499747..c933a4b 100644 --- a/web/src/routes/me/uppers/+page.svelte +++ b/web/src/routes/me/uppers/+page.svelte @@ -54,9 +54,14 @@
-
+
{#if !loading} - 共 {totalCount} 个 UP 主 +
+ 共 {totalCount} 个 UP 主 +
+
+ 当前第 {currentPage + 1} / {totalPages} 页 +
{/if}
diff --git a/web/src/routes/video/[id]/+page.svelte b/web/src/routes/video/[id]/+page.svelte index b9f3fe0..e5a32ec 100644 --- a/web/src/routes/video/[id]/+page.svelte +++ b/web/src/routes/video/[id]/+page.svelte @@ -4,6 +4,7 @@ import { onMount } from 'svelte'; import { Button } from '$lib/components/ui/button/index.js'; import api from '$lib/api'; + import SquareArrowOutUpRightIcon from '@lucide/svelte/icons/square-arrow-out-up-right'; import type { ApiError, VideoResponse, UpdateVideoStatusRequest } from '$lib/types'; import RotateCcwIcon from '@lucide/svelte/icons/rotate-ccw'; import EditIcon from '@lucide/svelte/icons/edit'; @@ -134,6 +135,17 @@ 重置 +
@@ -141,6 +153,7 @@
- 筛选视频源: + 筛选:
- 共 {totalPages} 页 + 当前第 {$appStateStore.currentPage + 1} / {totalPages} 页