1
1
mirror of https://github.com/neosubhamoy/neodlp.git synced 2026-03-22 15:05:48 +05:30

2 Commits

View File

@@ -11,7 +11,7 @@ import { useUpdateDownloadStatus } from "@/services/mutations";
import { useQueryClient } from "@tanstack/react-query"; import { useQueryClient } from "@tanstack/react-query";
import { useFetchAllDownloadStates, useFetchAllkVPairs, useFetchAllSettings } from "@/services/queries"; import { useFetchAllDownloadStates, useFetchAllkVPairs, useFetchAllSettings } from "@/services/queries";
import { config } from "@/config"; import { config } from "@/config";
import * as fs from "@tauri-apps/plugin-fs"; // import * as fs from "@tauri-apps/plugin-fs";
import { useYtDlpUpdater } from "@/helpers/use-ytdlp-updater"; import { useYtDlpUpdater } from "@/helpers/use-ytdlp-updater";
import { getVersion } from "@tauri-apps/api/app"; import { getVersion } from "@tauri-apps/api/app";
import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow";
@@ -193,21 +193,18 @@ export default function App({ children }: { children: React.ReactNode }) {
const tempDownloadDirPath = isFlatpak ? await join(downloadDirPath, config.appName, '.tempdownloads') : await join(tempDirPath, config.appPkgName, 'downloads'); const tempDownloadDirPath = isFlatpak ? await join(downloadDirPath, config.appName, '.tempdownloads') : await join(tempDirPath, config.appPkgName, 'downloads');
const appDownloadDirPath = await join(downloadDirPath, config.appName); const appDownloadDirPath = await join(downloadDirPath, config.appName);
LOG.info('NEODLP', `Resolved paths: isFlatpak: ${isFlatpak}, downloadDir: ${downloadDirPath}, tempDir: ${tempDirPath}, tempDownloadDir: ${tempDownloadDirPath}, appDownloadDir: ${appDownloadDirPath}`); // if (!await fs.exists(tempDownloadDirPath)) fs.mkdir(tempDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${tempDownloadDirPath}`) });
if (!await fs.exists(tempDownloadDirPath)) fs.mkdir(tempDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${tempDownloadDirPath}`) });
setPath('ffmpegPath', ffmpegPath); setPath('ffmpegPath', ffmpegPath);
setPath('tempDownloadDirPath', tempDownloadDirPath); setPath('tempDownloadDirPath', tempDownloadDirPath);
if (DOWNLOAD_DIR) { if (DOWNLOAD_DIR) {
setPath('downloadDirPath', DOWNLOAD_DIR); setPath('downloadDirPath', DOWNLOAD_DIR);
} else { } else {
if(!await fs.exists(appDownloadDirPath)) fs.mkdir(appDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${appDownloadDirPath}`) }); // if(!await fs.exists(appDownloadDirPath)) fs.mkdir(appDownloadDirPath, { recursive: true }).then(() => { console.log(`Created DIR: ${appDownloadDirPath}`) });
setPath('downloadDirPath', appDownloadDirPath); setPath('downloadDirPath', appDownloadDirPath);
} }
console.log('Paths initialized:', { ffmpegPath, tempDownloadDirPath, downloadDirPath: DOWNLOAD_DIR || appDownloadDirPath }); console.log('Paths initialized:', { ffmpegPath, tempDownloadDirPath, downloadDirPath: DOWNLOAD_DIR || appDownloadDirPath });
} catch (e) { } catch (e) {
LOG.error('NEODLP', `Failed to fetch paths: ${e}`);
console.error('Failed to fetch paths:', e); console.error('Failed to fetch paths:', e);
} }
}; };