From f3f2f0890e6ae3e95a7772eaf757922c4668a276 Mon Sep 17 00:00:00 2001 From: Ren Tatsumoto Date: Wed, 11 Sep 2024 13:38:39 +0300 Subject: [PATCH] add function mkplaylist() solves #11 --- impd | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/impd b/impd index 17f3320..cae55ed 100755 --- a/impd +++ b/impd @@ -846,6 +846,18 @@ rotate() { reshuffle } +mkplaylist() { + local -r m3u_path=$immersionpod_dir/$current/impd.m3u + + find "$immersionpod_dir/$current" \ + -type f \ + -printf '%P\n' \ + -regextype posix-extended \ + -iregex '.*\.(mp3|opus|ogg|m4a|wav|wma)$' | + shuf > "$m3u_path" + echo "created file '$m3u_path'" +} + grep_mpd_dir() { # https://wiki.archlinux.org/index.php/Music_Player_Daemon#Configuration grep -Pos 'music_directory\s*"?\K[^"]*(?="?)' -- ~/.config/mpd/mpd.conf