Skip to content

Open-source download manager & offline media toolbox for YouTube, music, social media, learning platforms & 1,800+ sites. Built with Tauri 2.0, Rust & Svelte.

fix(portable): keep plugin external cache in the app data dir; document portable mode

Antonio Leandro6a82449813d2
diff --git a/README.md b/README.md
index a53f53ff..7af0f40f 100644
--- a/README.md
+++ b/README.md
@@ -259,6 +259,9 @@ Online courses, YouTube, TikTok, Instagram, Twitter/X, Reddit, Twitch, Vimeo, Bi
**Does it work on Windows, macOS, and Linux?**
Yes, all three. Windows is a portable `.exe`, macOS is a `.dmg`, Linux is a Flatpak or bundle.
+**Can I keep everything in one folder (true portable mode, e.g. on a USB stick)?**
+Yes. Create an empty file named `portable.txt` (or `.portable`) next to the `.exe` and relaunch. OmniGet then stores settings, the database, cookies, plugins, caches, and the bundled yt-dlp/FFmpeg in a `data` folder beside the executable — nothing is written to `AppData\Roaming` or other user folders. Without that file, the app uses the standard per-user data directory.
+
**Can it download audio only, or just a clip?**
Yes. Extract audio as MP3, M4A, Opus, FLAC, or WAV, or set a start and end time to download only the part you need.
diff --git a/src-tauri/src/plugin_host.rs b/src-tauri/src/plugin_host.rs
index ba92957b..ef948c8f 100644
--- a/src-tauri/src/plugin_host.rs
+++ b/src-tauri/src/plugin_host.rs
@@ -120,11 +120,22 @@ impl<R: Runtime + 'static> PluginHost for PluginHostImpl<R> {
);
}
- let base = dirs::cache_dir().ok_or_else(|| {
- anyhow::anyhow!("external_data_cache: OS cache dir unavailable on this platform")
- })?;
+ // portable installs keep every file next to the app, so the cache
+ // lives under the app data dir instead of the OS cache dir
+ let base = if std::env::var("OMNIGET_PORTABLE").is_ok() {
+ omniget_core::core::paths::app_data_dir()
+ .ok_or_else(|| anyhow::anyhow!("external_data_cache: app data dir unavailable"))?
+ .join("cache")
+ } else {
+ dirs::cache_dir()
+ .ok_or_else(|| {
+ anyhow::anyhow!(
+ "external_data_cache: OS cache dir unavailable on this platform"
+ )
+ })?
+ .join("wtf.tonho.omniget")
+ };
let dir = base
- .join("wtf.tonho.omniget")
.join("external-cache")
.join(plugin_id)
.join(namespace);