diff --git a/src-tauri/resources/autostart/macos/autostart.plist b/src-tauri/resources/autostart/macos/autostart.plist index 2f60474..a382eae 100644 --- a/src-tauri/resources/autostart/macos/autostart.plist +++ b/src-tauri/resources/autostart/macos/autostart.plist @@ -6,7 +6,7 @@ com.neosubhamoy.neodlp ProgramArguments - /Applications/neodlp.app/Contents/MacOS/neodlp + /Applications/NeoDLP.app/Contents/MacOS/neodlp --hidden RunAtLoad diff --git a/src-tauri/resources/msghost-manifest/linux/chrome.json b/src-tauri/resources/msghost-manifest/linux/chrome.json index 60ee052..f48ef8f 100644 --- a/src-tauri/resources/msghost-manifest/linux/chrome.json +++ b/src-tauri/resources/msghost-manifest/linux/chrome.json @@ -3,5 +3,5 @@ "description": "NeoDLP MsgHost", "path": "/usr/bin/neodlp-msghost", "type": "stdio", - "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/", "chrome-extension://agkddibgemhefmdhlnooiakfnhihhbdb/"] + "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] } \ No newline at end of file diff --git a/src-tauri/resources/msghost-manifest/macos/chrome.json b/src-tauri/resources/msghost-manifest/macos/chrome.json index 8c93946..7562e1c 100644 --- a/src-tauri/resources/msghost-manifest/macos/chrome.json +++ b/src-tauri/resources/msghost-manifest/macos/chrome.json @@ -3,5 +3,5 @@ "description": "NeoDLP MsgHost", "path": "/Applications/NeoDLP.app/Contents/Resources/neodlp-msghost", "type": "stdio", - "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/", "chrome-extension://agkddibgemhefmdhlnooiakfnhihhbdb/"] + "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] } \ No newline at end of file diff --git a/src-tauri/resources/msghost-manifest/windows/chrome.json b/src-tauri/resources/msghost-manifest/windows/chrome.json index f68a951..0b8d3a6 100644 --- a/src-tauri/resources/msghost-manifest/windows/chrome.json +++ b/src-tauri/resources/msghost-manifest/windows/chrome.json @@ -3,5 +3,5 @@ "description": "NeoDLP MsgHost", "path": "neodlp-msghost.exe", "type": "stdio", - "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/", "chrome-extension://agkddibgemhefmdhlnooiakfnhihhbdb/"] + "allowed_origins": ["chrome-extension://mehopeailfjmiloiiohgicphlcgpompf/"] } \ No newline at end of file diff --git a/src/pages/settings.tsx b/src/pages/settings.tsx index 31e946f..8e2e9a2 100644 --- a/src/pages/settings.tsx +++ b/src/pages/settings.tsx @@ -7,7 +7,7 @@ import { Switch } from "@/components/ui/switch"; import { Label } from "@/components/ui/label"; import { Button } from "@/components/ui/button"; import { useToast } from "@/hooks/use-toast"; -import { ArrowDownToLine, ArrowRight, EthernetPort, ExternalLink, FileVideo, Folder, FolderOpen, Info, Loader2, LucideIcon, Monitor, Moon, Radio, RotateCcw, RotateCw, Sun, Terminal, WandSparkles, Wifi, Wrench } from "lucide-react"; +import { ArrowDownToLine, ArrowRight, BrushCleaning, EthernetPort, ExternalLink, FileVideo, Folder, FolderOpen, Info, Loader2, LucideIcon, Monitor, Moon, Radio, RotateCcw, RotateCw, Sun, Terminal, WandSparkles, Wifi, Wrench } from "lucide-react"; import { cn } from "@/lib/utils"; import { useEffect } from "react"; import { useTheme } from "@/providers/themeProvider"; @@ -24,6 +24,8 @@ import { invoke } from "@tauri-apps/api/core"; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog"; import { SlidingButton } from "@/components/custom/slidingButton"; import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; +import * as fs from "@tauri-apps/plugin-fs"; +import { join } from "@tauri-apps/api/path"; const websocketPortSchema = z.object({ port: z.coerce.number({ @@ -81,6 +83,7 @@ export default function SettingsPage() { ); const downloadDirPath = useBasePathsStore((state) => state.downloadDirPath); + const tempDownloadDirPath = useBasePathsStore((state) => state.tempDownloadDirPath); const setPath = useBasePathsStore((state) => state.setPath); const { saveSettingsKey, resetSettings } = useSettings(); const { updateYtDlp } = useYtDlpUpdater(); @@ -110,6 +113,35 @@ export default function SettingsPage() { } } + const cleanTemporaryDownloads = async () => { + const tempFiles = await fs.readDir(tempDownloadDirPath ?? ''); + if (tempFiles.length > 0) { + try { + for (const file of tempFiles) { + if (file.isFile) { + const filePath = await join(tempDownloadDirPath ?? '', file.name); + await fs.remove(filePath); + } + } + toast({ + title: "Temporary Downloads Cleaned", + description: "All temporary downloads have been successfully cleaned up.", + }); + } catch (e) { + toast({ + title: "Temporary Downloads Cleanup Failed", + description: "An error occurred while trying to clean up temporary downloads. Please try again.", + variant: "destructive", + }); + } + } else { + toast({ + title: "No Temporary Downloads", + description: "There are no temporary downloads to clean up.", + }); + } + } + const proxyUrlForm = useForm>({ resolver: zodResolver(proxyUrlSchema), defaultValues: { @@ -407,6 +439,35 @@ export default function SettingsPage() { +
+

Temporary Download Folder

+

Clean up temporary downloads (broken, cancelled, paused downloads)

+
+ + + + + + + + Clean up all temporary downloads? + Are you sure you want to clean up all temporary downloads? This will remove all broken, cancelled and paused downloads from the temporary folder. Paused downloads will re-start from the begining. This action cannot be undone! + + + Cancel + cleanTemporaryDownloads()} + >Clean + + + +
+