From 6800ae73d8736cadff6be5dc7f9d99ad041487df Mon Sep 17 00:00:00 2001 From: Subhamoy Biswas Date: Mon, 23 Feb 2026 11:02:07 +0530 Subject: [PATCH] refactor: init compat with flatpak --- com.neosubhamoy.neodlp.desktop | 10 ++++++++++ com.neosubhamoy.neodlp.metainfo.xml | 31 +++++++++++++++++++++++++++++ src-tauri/src/lib.rs | 12 +++++++++++ src/helpers/use-linux-registerer.ts | 4 +++- 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 com.neosubhamoy.neodlp.desktop create mode 100644 com.neosubhamoy.neodlp.metainfo.xml diff --git a/com.neosubhamoy.neodlp.desktop b/com.neosubhamoy.neodlp.desktop new file mode 100644 index 0000000..537d543 --- /dev/null +++ b/com.neosubhamoy.neodlp.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application + +Name=NeoDLP +Comment=Modern video/audio downloader based on yt-dlp with browser integration. +Icon=com.neosubhamoy.neodlp +Exec=neodlp +Terminal=false +Categories=Utility; +Keywords=neodlp;downloader;yt-dlp-gui; diff --git a/com.neosubhamoy.neodlp.metainfo.xml b/com.neosubhamoy.neodlp.metainfo.xml new file mode 100644 index 0000000..2d45aa6 --- /dev/null +++ b/com.neosubhamoy.neodlp.metainfo.xml @@ -0,0 +1,31 @@ + + + com.neosubhamoy.neodlp + NeoDLP + Modern video/audio downloader based on yt-dlp with browser integration + Subhamoy Biswas + CC0-1.0 + MIT + https://neodlp.neosubhamoy.com + https://github.com/neosubhamoy/neodlp/issues + +

+ NeoDLP is a cross-platform desktop application designed for downloading videos and audio from various online sources based on yt-dlp. + + It offers modern user interface, lots of customization options and seamless browser integration. +

+
+ com.neosubhamoy.neodlp.desktop + + + https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/downloader.png + NeoDLP Downloader + + + + + + https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.1 + + +
diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 90608fe..38fc8f5 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -184,6 +184,16 @@ fn get_current_app_path() -> Result { .into_owned()) } +#[tauri::command] +fn is_flatpak() -> bool { + std::env::var("FLATPAK").is_ok() +} + +#[tauri::command] +fn get_appimage_path() -> Option { + std::env::var("APPDIR").ok() +} + #[tauri::command] async fn update_config( new_config: Config, @@ -604,6 +614,8 @@ pub async fn run() { get_config_file_path, restart_websocket_server, get_current_app_path, + is_flatpak, + get_appimage_path ]) .run(tauri::generate_context!()) .expect("error while running tauri application"); diff --git a/src/helpers/use-linux-registerer.ts b/src/helpers/use-linux-registerer.ts index a2363c3..0f45ed6 100644 --- a/src/helpers/use-linux-registerer.ts +++ b/src/helpers/use-linux-registerer.ts @@ -2,6 +2,7 @@ import { join, resourceDir, homeDir } from "@tauri-apps/api/path"; import * as fs from "@tauri-apps/plugin-fs"; import { useKvPairs } from "@/helpers/use-kvpairs"; import { useSettingsPageStatesStore } from "@/services/store"; +import { invoke } from "@tauri-apps/api/core"; interface FileMap { source: string; @@ -21,7 +22,8 @@ export function useLinuxRegisterer() { { source: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', destination: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/getpot_bgutil_http.py', dir: 'yt-dlp-plugins/bgutil-ytdlp-pot-provider/yt_dlp_plugins/extractor/' }, ]; - const resourceDirPath = await resourceDir(); + const isFlatpak = await invoke('is_flatpak'); + const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir(); const homeDirPath = await homeDir(); for (const file of filesToCopy) {