edit 2scan script and fix playlist-check script

This commit is contained in:
2026-10-02 18:05:07 +02:00
parent 12eacb13ad
commit cf2acc3517
6 changed files with 38 additions and 28 deletions
+1
View File
@@ -25,6 +25,7 @@
# auto_update "yes"
max_playlist_length "131072"
max_output_buffer_size "32768"
replaygain "track"
'';
};
+16 -8
View File
@@ -12,15 +12,23 @@
' _ {} | sort
'')
# (pkgs.writeShellScriptBin "2scan" ''
# find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.aiff" \) -print0 |
# xargs -0 -P"$(nproc)" -I{} sh -c '
# if ! ffprobe -v quiet -show_entries format_tags \
# -of default=nw=1:nk=1 "$1" 2>/dev/null |
# grep -q -E "Visit https?://[^ ]+"; then
# echo "Match found in: $1"
# fi
# ' _ {}
# '')
(pkgs.writeShellScriptBin "2scan" ''
find . -type f \( -iname "*.mp3" -o -iname "*.flac" -o -iname "*.m4a" -o -iname "*.ogg" -o -iname "*.wav" -o -iname "*.aiff" \) -print0 |
xargs -0 -P"$(nproc)" -I{} sh -c '
if ! ffprobe -v quiet -show_entries format_tags \
-of default=nw=1:nk=1 "$1" 2>/dev/null |
grep -q -E "Visit https?://[^ ]+"; then
echo "Match found in: $1"
fd -e flac -e mp3 -e m4a -e aiff -x sh -c '
if ! strings "$1" | grep -qE "^COMMENT=Visit https?://[^ ]+"; then
echo "Match found in: $1"
fi
' _ {}
' sh {}
'')
(pkgs.writeShellScriptBin "enable-hypervisor" ''
@@ -38,7 +46,7 @@
BASENAME="/home/user/Music/$SELECTED_SONGS"
# echo $BASENAME | kitty +kitten clipboard
shopt -s extglob
if grep -q "$BASENAME" "$PLAYLIST_DIR"/!(active\ -\ new|other\ -\ lostfrog).m3u
if grep -qF "$BASENAME" "$PLAYLIST_DIR"/!(active\ -\ new|other\ -\ lostfrog).m3u
then
notify-send "Song is in a playlist";
else