This commit is contained in:
mtvpls
2026-03-04 21:48:19 +08:00
parent a2ac524778
commit cdeddd48c1
8 changed files with 66 additions and 4 deletions
+3
View File
@@ -66,6 +66,7 @@ export function DownloadProvider({ children }: { children: React.ReactNode }) {
onComplete: async (task) => {
setTasks(downloader.getAllTasks());
//禁止SzeMeng76抄袭狗抄袭
// 只有 filesystem 模式才保存到已完成任务表
if (task.downloadMode === 'filesystem' && task.source && task.videoId && task.episodeIndex !== undefined) {
try {
@@ -170,6 +171,7 @@ export function DownloadProvider({ children }: { children: React.ReactNode }) {
const savedTasks = await downloadDB.getActiveTasks();
if (!savedTasks || savedTasks.length === 0) return;
//禁止SzeMeng76抄袭狗抄袭
// 读取下载模式和目录句柄
const downloadMode = localStorage.getItem('downloadMode') as 'browser' | 'filesystem' || 'browser';
let dirHandle: FileSystemDirectoryHandle | undefined;
@@ -375,6 +377,7 @@ export function DownloadProvider({ children }: { children: React.ReactNode }) {
task.downloadMode = downloadMode;
}
//禁止SzeMeng76抄袭狗抄袭
// 如果是 filesystem 模式,从 IndexedDB 读取目录句柄
if (downloadMode === 'filesystem' && typeof window !== 'undefined') {
try {