mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2025-12-20 07:49:33 +05:30
(refactor): minor tweaks for latest dependency migration
This commit is contained in:
@@ -9,10 +9,10 @@ import { useToast } from "@/hooks/use-toast";
|
||||
import { useAppContext } from "@/providers/appContextProvider";
|
||||
import { useCurrentVideoMetadataStore, useDownloaderPageStatesStore } from "@/services/store";
|
||||
import { determineFileType, fileFormatFilter, formatBitrate, formatDurationString, formatFileSize, formatReleaseDate, formatYtStyleCount, isObjEmpty, sortByBitrate } from "@/utils";
|
||||
import { Calendar, Clock, DownloadCloud, Eye, Info, Loader2, Music, ThumbsUp, Video, File, ListVideo } from "lucide-react";
|
||||
import { Calendar, Clock, DownloadCloud, Eye, Info, Loader2, Music, ThumbsUp, Video, File, ListVideo, PackageSearch } from "lucide-react";
|
||||
import { FormatSelectionGroup, FormatSelectionGroupItem } from "@/components/custom/formatSelectionGroup";
|
||||
import { useEffect, useRef } from "react";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/ui/toggle-group";
|
||||
import { ToggleGroup, ToggleGroupItem } from "@/components/custom/legacyToggleGroup";
|
||||
import { VideoFormat } from "@/types/video";
|
||||
// import { PlaylistToggleGroup, PlaylistToggleGroupItem } from "@/components/custom/playlistToggleGroup";
|
||||
import { PlaylistSelectionGroup, PlaylistSelectionGroupItem } from "@/components/custom/playlistSelectionGroup";
|
||||
@@ -223,9 +223,9 @@ export default function DownloaderPage() {
|
||||
|
||||
return (
|
||||
<div className="container mx-auto p-4 space-y-4 relative" ref={containerRef}>
|
||||
<Card>
|
||||
<Card className="gap-4">
|
||||
<CardHeader>
|
||||
<CardTitle>{config.appName} Search</CardTitle>
|
||||
<CardTitle className="flex items-center"><PackageSearch className="size-5 mr-3" />{config.appName} Search</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent className="space-y-4">
|
||||
<Form {...searchForm}>
|
||||
@@ -239,7 +239,7 @@ export default function DownloaderPage() {
|
||||
<FormControl>
|
||||
<Input
|
||||
className="focus-visible:ring-0"
|
||||
placeholder="Enter URL to search..."
|
||||
placeholder="Enter Video URL to Search"
|
||||
{...field}
|
||||
/>
|
||||
</FormControl>
|
||||
@@ -352,7 +352,7 @@ export default function DownloaderPage() {
|
||||
}
|
||||
}}
|
||||
>
|
||||
<p className="text-xs">Suggested (Best)</p>
|
||||
<p className="text-xs">Suggested</p>
|
||||
<div className="">
|
||||
<FormatSelectionGroupItem
|
||||
key="best"
|
||||
|
||||
@@ -8,7 +8,7 @@ import { useToast } from "@/hooks/use-toast";
|
||||
import { useAppContext } from "@/providers/appContextProvider";
|
||||
import { useDownloadActionStatesStore, useDownloadStatesStore } from "@/services/store";
|
||||
import { formatBitrate, formatCodec, formatDurationString, formatFileSize, formatSecToTimeString, formatSpeed } from "@/utils";
|
||||
import { AudioLines, CircleArrowDown, CircleCheck, Clock, File, FileAudio2, FileQuestion, FileVideo2, FolderInput, ListVideo, Loader2, Music, Pause, Play, Trash2, Video, X } from "lucide-react";
|
||||
import { AudioLines, Clock, CloudDownload, File, FileAudio2, FileQuestion, FileVideo2, FolderInput, ListVideo, Loader2, Music, PackageCheck, Pause, Play, Trash2, Video, X } from "lucide-react";
|
||||
import { invoke } from "@tauri-apps/api/core";
|
||||
import * as fs from "@tauri-apps/plugin-fs";
|
||||
import { DownloadState } from "@/types/download";
|
||||
@@ -100,8 +100,8 @@ export default function LibraryPage() {
|
||||
<div className="container mx-auto p-4 space-y-4">
|
||||
<Heading title="Library" description="Manage all your downloads in one place" />
|
||||
<div className="w-full fle flex-col">
|
||||
<div className="flex w-full items-center gap-2 mb-2">
|
||||
<CircleArrowDown className="size-4" />
|
||||
<div className="flex w-full items-center gap-3 mb-2">
|
||||
<CloudDownload className="size-5" />
|
||||
<h3 className="text-nowrap font-semibold">Incomplete Downloads</h3>
|
||||
</div>
|
||||
<Separator orientation="horizontal" className="" />
|
||||
@@ -279,8 +279,8 @@ export default function LibraryPage() {
|
||||
)}
|
||||
</div>
|
||||
<div className="w-full fle flex-col">
|
||||
<div className="flex w-full items-center gap-2 mb-2">
|
||||
<CircleCheck className="size-4" />
|
||||
<div className="flex w-full items-center gap-3 mb-2">
|
||||
<PackageCheck className="size-5" />
|
||||
<h3 className="text-nowrap font-semibold">Completed Downloads</h3>
|
||||
</div>
|
||||
<Separator orientation="horizontal" className="" />
|
||||
|
||||
@@ -24,13 +24,15 @@ import { invoke } from "@tauri-apps/api/core";
|
||||
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger } from "@/components/ui/alert-dialog";
|
||||
|
||||
const websocketPortSchema = z.object({
|
||||
port: z.string().min(1, { message: "Websocket port is required" })
|
||||
.regex(/^\d+$/, { message: "Websocket port must be a number" })
|
||||
.transform((val) => parseInt(val, 10))
|
||||
.refine((port) => port >= 50000 && port <= 60000, {
|
||||
message: "Websocket port must be between 50000 and 60000",
|
||||
})
|
||||
});
|
||||
port: z.coerce.number({
|
||||
required_error: "Websocket Port is required",
|
||||
invalid_type_error: "Websocket Port must be a valid number",
|
||||
}).min(50000, {
|
||||
message: "Websocket Port must be at least 50000"
|
||||
}).max(60000, {
|
||||
message: "Websocket Port must be at most 60000"
|
||||
}),
|
||||
})
|
||||
|
||||
const proxyUrlSchema = z.object({
|
||||
url: z.string().min(1, { message: "Proxy URL is required" }).url({ message: "Invalid URL format" })
|
||||
@@ -163,7 +165,7 @@ export default function SettingsPage() {
|
||||
<Card className="p-4 space-y-4 my-4">
|
||||
<div className="w-full flex gap-4 items-center justify-between">
|
||||
<div className="flex gap-4 items-center">
|
||||
<div className="imgwrapper w-10 h-10 flex items-center justify-center bg-gradient-to-r from-[#4444FF] to-[#FF43D0] rounded-md overflow-hidden border border-border">
|
||||
<div className="imgwrapper w-10 h-10 flex items-center justify-center bg-linear-65 from-[#FF43D0] to-[#4444FF] rounded-md overflow-hidden border border-border">
|
||||
<Terminal className="size-5 text-white" />
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
@@ -276,7 +278,7 @@ export default function SettingsPage() {
|
||||
<p className="text-sm text-muted-foreground mb-3">Set maximum number of allowed parallel downloads</p>
|
||||
<Slider
|
||||
id="max-parallel-downloads"
|
||||
className="w-[350px]"
|
||||
className="w-[350px] mb-2"
|
||||
value={[maxParallelDownloads]}
|
||||
min={1}
|
||||
max={5}
|
||||
@@ -341,7 +343,7 @@ export default function SettingsPage() {
|
||||
<Card className="p-4 space-y-4 my-4">
|
||||
<div className="w-full flex gap-4 items-center justify-between">
|
||||
<div className="flex gap-4 items-center">
|
||||
<div className="imgwrapper w-10 h-10 flex items-center justify-center bg-gradient-to-r from-[#4444FF] to-[#FF43D0] rounded-md overflow-hidden border border-border">
|
||||
<div className="imgwrapper w-10 h-10 flex items-center justify-center bg-linear-65 from-[#FF43D0] to-[#4444FF] rounded-md overflow-hidden border border-border">
|
||||
<Radio className="size-5 text-white" />
|
||||
</div>
|
||||
<div className="flex flex-col">
|
||||
|
||||
Reference in New Issue
Block a user