summaryrefslogtreecommitdiffstats
path: root/.bin/cmus-consistency
diff options
context:
space:
mode:
authorRomain Gonçalves <me@rgoncalves.se>2024-05-14 18:53:03 +0200
committerRomain Gonçalves <me@rgoncalves.se>2024-05-14 18:53:03 +0200
commit612dbb6993c8a548744f29a4d15d6b31325357c8 (patch)
tree0d61cee0ea74ac811268d0ffc00d3d55f7174112 /.bin/cmus-consistency
parent23e2bfd987c430bb41bc7860c46c2f572e9e2db4 (diff)
downloaddots-612dbb6993c8a548744f29a4d15d6b31325357c8.tar.gz
Tue May 14 06:53:03 PM CEST 2024HEADtrunk
Diffstat (limited to '.bin/cmus-consistency')
-rwxr-xr-x.bin/cmus-consistency23
1 files changed, 23 insertions, 0 deletions
diff --git a/.bin/cmus-consistency b/.bin/cmus-consistency
new file mode 100755
index 0000000..dae667b
--- /dev/null
+++ b/.bin/cmus-consistency
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+set -xe
+
+music_urls_file="${HOME}/.config/music/urls"
+music_path="${HOME}/music"
+music_album_list_file="$(mktemp)"
+
+find "${music_path}" -maxdepth 1 -type d -not -path "${music_path}" -not -name ".*" \
+ | sort \
+ | xargs -I {} basename {} \
+ > "${music_album_list_file}"
+
+grep -v "^http" "${music_urls_file}" \
+ | grep -v "^#" \
+ | tr -s "\n" \
+ | sort \
+ | uniq \
+ | diff - "${music_album_list_file}" \
+ | grep -e "^>" -e "^<" \
+ | sort -V
+
+rm "${music_album_list_file}"
remember that computers suck.