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} 页