diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index c5cd293..0000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 2 - -[*.{bat,cmd}] -end_of_line = crlf diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index a770ead..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends" : "@edenjs/eden" -} diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index c54ea1d..0000000 --- a/.gitattributes +++ /dev/null @@ -1,22 +0,0 @@ -# Automatically normalize line endings for all text-based files -# http://git-scm.com/docs/gitattributes#_end_of_line_conversion -* text=auto - -# For the following file types, normalize line endings to LF on -# checkin and prevent conversion to CRLF when they are checked out -# (this is required in order to prevent newline related issues like, -# for example, after the build script is run) -.* text eol=lf -*.css text eol=lf -*.html text eol=lf -*.jade text eol=lf -*.js text eol=lf -*.json text eol=lf -*.less text eol=lf -*.scss text eol=lf -*.md text eol=lf -*.sh text eol=lf -*.txt text eol=lf -*.xml text eol=lf -*.bat text eol=crlf -*.cmd text eol=crlf \ No newline at end of file diff --git a/.gitignore b/.gitignore index 25d22d4..9a28ca4 100644 --- a/.gitignore +++ b/.gitignore @@ -1,52 +1,5 @@ -# Debug log from npm -npm-debug.log - -# Error log from yarn -yarn-error.log - -# yarn lock - do work pls -yarn.lock - -# nodejs modules node_modules/ - -# edenjs stuff -data/ -config.js -edenappconfig.js - -# IDE -.idea -.remote-sync.json - -# Log and Sentry -*.log -*.sentry - -# Redis -*.rdb - -# sqlite files -*.db -*.sdb -*.sqlite -*.db3 -*.s3db -*.sqlite3 -*.sl3 -*.db2 -*.s2db -*.sqlite2 -*.sl2 - -# Other junk .*.swp ._* .DS_Store -.hg -.npmrc -.lock-wscript -.svn -.wafpickle-* -config.gypi -CVS +result diff --git a/flake.nix b/flake.nix index 9bd758b..57cf60f 100644 --- a/flake.nix +++ b/flake.nix @@ -11,6 +11,12 @@ in { packages.mudl = pkgs.buildNpmPackage { src = ./.; + buildInputs = [ pkgs.makeWrapper ]; + postInstall = '' + chmod +x $out/index.js + makeWrapper $out/index.js $out/bin/mudl --prefix PATH : ${nixpkgs.lib.makeBinPath (with pkgs; [ yt-dlp imagemagick sacad id3v2 ])} + rm $out/bin/npm + ''; }; defaultPackage = self.packages.${system}.mudl; diff --git a/index.js b/index.js index 05aac95..d1ac68f 100644 --- a/index.js +++ b/index.js @@ -72,7 +72,7 @@ async function thing(source, excess) { inputType = 'url'; console.log(`Temporarily saving to ${TMP_DIR}`); - await exec(`youtube-dl --write-thumbnail -f bestaudio -x -o "${TMP_DIR}/[%(album)s] -- [%(artist)s] -- [%(track_number)s] -- [%(track)s] -- [%(title)s].%(ext)s" ${source}`); + await exec(`yt-dlp --write-thumbnail -f bestaudio -x -o "${TMP_DIR}/[%(album)s] -- [%(artist)s] -- [%(track_number)s] -- [%(track)s] -- [%(title)s].%(ext)s" ${source}`); console.log('Done saving'); const filesList = await fs.readdir(TMP_DIR); diff --git a/package.json b/package.json index cad53f1..9c860c4 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "mudl", "description": "nothing yet", - "version": "1.0.2", - "bin": { - "mudl": "./index.js" - }, + "version": "1.0.3", "engines": { "node": ">= 11.0.0" }, + "bin": { + "mudl": "./index.js" + }, "dependencies": { "no-op": "^1.0.3" }