From 612dbb6993c8a548744f29a4d15d6b31325357c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 14 May 2024 18:53:03 +0200 Subject: Tue May 14 06:53:03 PM CEST 2024 --- .bin/cmus-find-unused | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 .bin/cmus-find-unused (limited to '.bin/cmus-find-unused') diff --git a/.bin/cmus-find-unused b/.bin/cmus-find-unused new file mode 100755 index 0000000..2fd5f1c --- /dev/null +++ b/.bin/cmus-find-unused @@ -0,0 +1,20 @@ +#!/bin/sh +# Find tracks in no playlist + +set -xe + +cmus_path="${HOME}/.config/cmus" +music_path="${HOME}/music" +cmus_playlist_files="$(mktemp)" + +cat "${cmus_path}/playlists/"* \ + | sort \ + | uniq \ + > "${cmus_playlist_files}" + +find "${music_path}" -type f -not -name ".*" \ + | sort \ + | uniq \ + | comm -23 - "${cmus_playlist_files}" + +rm "${cmus_playlist_files}" -- cgit v1.2.3