Skip to content

Commit 6800ae7

Browse files
committed
refactor: init compat with flatpak
1 parent 2fe4c43 commit 6800ae7

File tree

4 files changed

+56
-1
lines changed

4 files changed

+56
-1
lines changed

com.neosubhamoy.neodlp.desktop

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Type=Application
3+
4+
Name=NeoDLP
5+
Comment=Modern video/audio downloader based on yt-dlp with browser integration.
6+
Icon=com.neosubhamoy.neodlp
7+
Exec=neodlp
8+
Terminal=false
9+
Categories=Utility;
10+
Keywords=neodlp;downloader;yt-dlp-gui;
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?xml version='1.0' encoding='UTF-8'?>
2+
<component type="desktop-application">
3+
<id>com.neosubhamoy.neodlp</id>
4+
<name>NeoDLP</name>
5+
<summary>Modern video/audio downloader based on yt-dlp with browser integration</summary>
6+
<developer_name>Subhamoy Biswas</developer_name>
7+
<metadata_license>CC0-1.0</metadata_license>
8+
<project_license>MIT</project_license>
9+
<url type="homepage">https://neodlp.neosubhamoy.com</url>
10+
<url type="bugtracker">https://github.com/neosubhamoy/neodlp/issues</url>
11+
<description>
12+
<p>
13+
NeoDLP is a cross-platform desktop application designed for downloading videos and audio from various online sources based on yt-dlp.
14+
15+
It offers modern user interface, lots of customization options and seamless browser integration.
16+
</p>
17+
</description>
18+
<launchable type="desktop-id">com.neosubhamoy.neodlp.desktop</launchable>
19+
<screenshots>
20+
<screenshot type="default">
21+
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/downloader.png</image>
22+
<caption>NeoDLP Downloader</caption>
23+
</screenshot>
24+
</screenshots>
25+
<content_rating type="oars-1.1" />
26+
<releases>
27+
<release version="0.4.1" date="2026-02-18">
28+
<url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.1</url>
29+
</release>
30+
</releases>
31+
</component>

src-tauri/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,16 @@ fn get_current_app_path() -> Result<String, String> {
184184
.into_owned())
185185
}
186186

187+
#[tauri::command]
188+
fn is_flatpak() -> bool {
189+
std::env::var("FLATPAK").is_ok()
190+
}
191+
192+
#[tauri::command]
193+
fn get_appimage_path() -> Option<String> {
194+
std::env::var("APPDIR").ok()
195+
}
196+
187197
#[tauri::command]
188198
async fn update_config(
189199
new_config: Config,
@@ -604,6 +614,8 @@ pub async fn run() {
604614
get_config_file_path,
605615
restart_websocket_server,
606616
get_current_app_path,
617+
is_flatpak,
618+
get_appimage_path
607619
])
608620
.run(tauri::generate_context!())
609621
.expect("error while running tauri application");

src/helpers/use-linux-registerer.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { join, resourceDir, homeDir } from "@tauri-apps/api/path";
22
import * as fs from "@tauri-apps/plugin-fs";
33
import { useKvPairs } from "@/helpers/use-kvpairs";
44
import { useSettingsPageStatesStore } from "@/services/store";
5+
import { invoke } from "@tauri-apps/api/core";
56

67
interface FileMap {
78
source: string;
@@ -21,7 +22,8 @@ export function useLinuxRegisterer() {
2122
{ 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/' },
2223
];
2324

24-
const resourceDirPath = await resourceDir();
25+
const isFlatpak = await invoke<boolean>('is_flatpak');
26+
const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir();
2527
const homeDirPath = await homeDir();
2628

2729
for (const file of filesToCopy) {

0 commit comments

Comments
 (0)