Last active
October 17, 2020 06:58
-
-
Save seanbreckenridge/8ec7da1c81cf3741396b29af5f7253b7 to your computer and use it in GitHub Desktop.
Lists abums not in any of my playlists https://github.com/seanbreckenridge/plaintext-playlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# lists any songs in my music folder that aren't in any playlists | |
# https://github.com/seanbreckenridge/plaintext-playlist | |
# get list of all songs | |
ALL_SONGS="$(plainplay listall "$(plainplay playlistdir)"/*)" | |
# move to my music directory | |
cd "$PLAINTEXT_PLAYLIST_MUSIC_DIR" || { | |
echo "Couldn't cd to music directory" 1>&2 | |
exit 1 | |
} | |
# find prints the leading directory file name, this is a approximation (the cut -d"/" -f2 | |
# most of the time prints the Artistname/AlbumName since thats what my Music directory looks like) | |
# read that filename into a loop, and check if that album has any songs in the giant list | |
# of all songs in my playlist | |
# if no matches are found, print that directory | |
find -maxdepth 3 -type f -printf '%h\n' | sort -u | cut -d "/" -f2- | while IFS= read -r dir; do | |
echo "$ALL_SONGS" | fgrep -q "$dir" 2>/dev/null || { | |
echo "${dir}" | |
} | |
done | |
# directories that are printed are interpreted by me as: | |
# 'there are no songs from this album in any of my playlists', that either means maybe | |
# I dont like any of the songs there, and thats fine, or I havent got around to listening | |
# to it and I should, and add songs into a playlist. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use this pretty often like
not_in_playlist | shuf -n1
, to pick a random album which isn't in any of my playlists yet.go create a playlist for that artist/genre if one doesnt exist, listen to the album, and add any songs I like to a playlist.
lets me make sure Im not missing any albums in my rotation, when running:
plainplay shuffleall "$(plainplay playlistdir)"/*
to shuffle all songs in my playlists