mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-03-22 10:15:50 +05:30
refactor: init compat with flatpak
This commit is contained in:
10
com.neosubhamoy.neodlp.desktop
Normal file
10
com.neosubhamoy.neodlp.desktop
Normal file
@@ -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;
|
||||
31
com.neosubhamoy.neodlp.metainfo.xml
Normal file
31
com.neosubhamoy.neodlp.metainfo.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<component type="desktop-application">
|
||||
<id>com.neosubhamoy.neodlp</id>
|
||||
<name>NeoDLP</name>
|
||||
<summary>Modern video/audio downloader based on yt-dlp with browser integration</summary>
|
||||
<developer_name>Subhamoy Biswas</developer_name>
|
||||
<metadata_license>CC0-1.0</metadata_license>
|
||||
<project_license>MIT</project_license>
|
||||
<url type="homepage">https://neodlp.neosubhamoy.com</url>
|
||||
<url type="bugtracker">https://github.com/neosubhamoy/neodlp/issues</url>
|
||||
<description>
|
||||
<p>
|
||||
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.
|
||||
</p>
|
||||
</description>
|
||||
<launchable type="desktop-id">com.neosubhamoy.neodlp.desktop</launchable>
|
||||
<screenshots>
|
||||
<screenshot type="default">
|
||||
<image>https://raw.githubusercontent.com/neosubhamoy/neodlp/main/.github/images/downloader.png</image>
|
||||
<caption>NeoDLP Downloader</caption>
|
||||
</screenshot>
|
||||
</screenshots>
|
||||
<content_rating type="oars-1.1" />
|
||||
<releases>
|
||||
<release version="0.4.1" date="2026-02-18">
|
||||
<url type="details">https://github.com/neosubhamoy/neodlp/releases/tag/v0.4.1</url>
|
||||
</release>
|
||||
</releases>
|
||||
</component>
|
||||
@@ -184,6 +184,16 @@ fn get_current_app_path() -> Result<String, String> {
|
||||
.into_owned())
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn is_flatpak() -> bool {
|
||||
std::env::var("FLATPAK").is_ok()
|
||||
}
|
||||
|
||||
#[tauri::command]
|
||||
fn get_appimage_path() -> Option<String> {
|
||||
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");
|
||||
|
||||
@@ -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<boolean>('is_flatpak');
|
||||
const resourceDirPath = isFlatpak ? '/app/lib/neodlp' : await resourceDir();
|
||||
const homeDirPath = await homeDir();
|
||||
|
||||
for (const file of filesToCopy) {
|
||||
|
||||
Reference in New Issue
Block a user