feat: toast when starting download

This commit is contained in:
Fredrik Burmester
2024-09-10 13:31:55 +03:00
parent c494b8e9f9
commit 2ed18d6588

View File

@@ -7,6 +7,7 @@ import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
import { runningProcesses } from "@/utils/atoms/downloads"; import { runningProcesses } from "@/utils/atoms/downloads";
import { writeToLog } from "@/utils/log"; import { writeToLog } from "@/utils/log";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { toast } from "sonner-native";
/** /**
* Custom hook for remuxing HLS to MP4 using FFmpeg. * Custom hook for remuxing HLS to MP4 using FFmpeg.
@@ -28,6 +29,10 @@ export const useRemuxHlsToMp4 = (item: BaseItemDto) => {
const startRemuxing = useCallback( const startRemuxing = useCallback(
async (url: string) => { async (url: string) => {
toast.success("Download started", {
invert: true,
});
const command = `-y -loglevel quiet -thread_queue_size 512 -protocol_whitelist file,http,https,tcp,tls,crypto -multiple_requests 1 -tcp_nodelay 1 -fflags +genpts -i ${url} -c copy -bufsize 50M -max_muxing_queue_size 4096 ${output}`; const command = `-y -loglevel quiet -thread_queue_size 512 -protocol_whitelist file,http,https,tcp,tls,crypto -multiple_requests 1 -tcp_nodelay 1 -fflags +genpts -i ${url} -c copy -bufsize 50M -max_muxing_queue_size 4096 ${output}`;
writeToLog( writeToLog(