diff --git a/src/App.tsx b/src/App.tsx index 62b16b0..190ae9e 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -3,7 +3,7 @@ import { TooltipProvider } from "@/components/ui/tooltip"; import { AppContext } from "@/providers/appContextProvider"; import { useEffect, useRef, useState } from "react"; import { arch, exeExtension } from "@tauri-apps/plugin-os"; -import { downloadDir, join, resourceDir, tempDir } from "@tauri-apps/api/path"; +import { downloadDir, join, resourceDir, tempDir, dataDir } from "@tauri-apps/api/path"; import { useBasePathsStore, useCurrentVideoMetadataStore, useDownloaderPageStatesStore, useDownloadStatesStore, useEnvironmentStore, useKvPairsStatesStore, useSettingsPageStatesStore } from "@/services/store"; import { isObjEmpty} from "@/utils"; import { Command } from "@tauri-apps/plugin-shell"; @@ -258,8 +258,9 @@ export default function App({ children }: { children: React.ReactNode }) { setIsFetchingYtDlpVersion(true); try { const isFlatpak = await invoke('is_flatpak'); + const xdgDataDir = await dataDir(); const command = isFlatpak - ? Command.create('sh', ['-c', `yt-dlp --version`]) + ? Command.create('sh', ['-c', `${xdgDataDir}/pip/bin/yt-dlp --version`]) : Command.sidecar('binaries/yt-dlp', ['--version']); const output = await command.execute(); if (output.code === 0) { @@ -309,11 +310,11 @@ export default function App({ children }: { children: React.ReactNode }) { console.log("Auto-update check already performed in this session, skipping"); return; } - const isFlatpak = await invoke('is_flatpak'); - if (isFlatpak) { - console.log("Flatpak detected! Skipping yt-dlp auto-update"); - return; - } + // const isFlatpak = await invoke('is_flatpak'); + // if (isFlatpak) { + // console.log("Flatpak detected! Skipping yt-dlp auto-update"); + // return; + // } hasRunYtDlpAutoUpdateRef.current = true; console.log("Checking yt-dlp auto-update with loaded config values:", { autoUpdate: YTDLP_AUTO_UPDATE, diff --git a/src/components/pages/settings/applicationSettings.tsx b/src/components/pages/settings/applicationSettings.tsx index 9de2db0..01097a5 100644 --- a/src/components/pages/settings/applicationSettings.tsx +++ b/src/components/pages/settings/applicationSettings.tsx @@ -1842,7 +1842,7 @@ function AppInfoSettings() { Flatpak Sandbox Detected! - It looks like you are running NeoDLP in a Flatpak sandbox. Some features like browser integration, desktop notifications, cookies, po tokens, changing download folder, revealing completed downloads in explorer, automatic yt-dlp updates and auto-launch on startup are not available in Flatpak due to sandbox restrictions. To use these features, please install the native linux build (DEB, RPM or AUR) of NeoDLP. + It looks like you are running NeoDLP in a Flatpak sandbox. Some features like browser integration, desktop notifications, cookies, changing download folder, revealing completed downloads in explorer, and auto-launch on startup are not available in Flatpak due to sandbox restrictions. To use these features, please install the native linux build (DEB, RPM or AUR) of NeoDLP. ) : isAppimage ? ( @@ -1933,7 +1933,7 @@ function AppInfoSettings() { } export function ApplicationSettings() { - const isFlatpak = useEnvironmentStore(state => state.isFlatpak); + // const isFlatpak = useEnvironmentStore(state => state.isFlatpak); const activeSubAppTab = useSettingsPageStatesStore(state => state.activeSubAppTab); const setActiveSubAppTab = useSettingsPageStatesStore(state => state.setActiveSubAppTab); @@ -1992,14 +1992,14 @@ export function ApplicationSettings() { saveSettingsKey('ytdlp_auto_update', checked)} />