Merge pull request #294517 from chewblacka/fix-ytdownloader
ytdownloader: add patch to set correct config dir
This commit is contained in:
commit
32146f3161
2 changed files with 25 additions and 3 deletions
18
pkgs/by-name/yt/ytdownloader/config-dir.patch
Normal file
18
pkgs/by-name/yt/ytdownloader/config-dir.patch
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
--- a/main.js
|
||||||
|
+++ b/main.js
|
||||||
|
@@ -13,6 +13,15 @@
|
||||||
|
const fs = require("fs");
|
||||||
|
const path = require("path");
|
||||||
|
autoUpdater.autoDownload = false;
|
||||||
|
+
|
||||||
|
+// Set the config directory to XDG_CONFIG_HOME/ytdownloader
|
||||||
|
+const xdgConfigHome = process.env.XDG_CONFIG_HOME;
|
||||||
|
+let configDir = app.getPath('home') + "/.config/ytdownloader";
|
||||||
|
+if (xdgConfigHome) {
|
||||||
|
+ configDir = xdgConfigHome + "/ytdownloader";
|
||||||
|
+}
|
||||||
|
+app.setPath ('userData', configDir);
|
||||||
|
+
|
||||||
|
/**@type {BrowserWindow} */
|
||||||
|
let win = null;
|
||||||
|
let secondaryWindow = null;
|
|
@ -25,19 +25,23 @@ buildNpmPackage rec {
|
||||||
buildInputs = [ ffmpeg yt-dlp ];
|
buildInputs = [ ffmpeg yt-dlp ];
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
name = "YTDownloader";
|
name = "ytDownloader";
|
||||||
exec = "ytdownloader %U";
|
exec = "ytdownloader %U";
|
||||||
icon = "ytdownloader";
|
icon = "ytdownloader";
|
||||||
desktopName = "YT Downloader";
|
desktopName = "ytDownloader";
|
||||||
comment = "A modern GUI video and audio downloader";
|
comment = "A modern GUI video and audio downloader";
|
||||||
categories = [ "Utility" ];
|
categories = [ "Utility" ];
|
||||||
startupWMClass = "YTDownloader";
|
startupWMClass = "ytDownloader";
|
||||||
};
|
};
|
||||||
|
|
||||||
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
||||||
|
|
||||||
dontNpmBuild = true;
|
dontNpmBuild = true;
|
||||||
|
|
||||||
|
# Patch config dir to ~/.config/ytdownloader
|
||||||
|
# Otherwise it stores config in ~/.config/Electron
|
||||||
|
patches = [ ./config-dir.patch ];
|
||||||
|
|
||||||
# Replace hardcoded ffmpeg and ytdlp paths
|
# Replace hardcoded ffmpeg and ytdlp paths
|
||||||
# Also stop it from downloading ytdlp
|
# Also stop it from downloading ytdlp
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
|
|
Loading…
Reference in a new issue