Here is another playlist, this one bash generated. It's a playlist for
everything up to a week prior to the most recent import.
function generated loyalist (){
local CONFIGFILE="${HOME}/.config/beets/config.yaml" &&
local MUSICDIR="${HOME}/Music" &&
# Get the PLAYLIST DIRECTORY from the config file.
local PLAYLISTDIR=$(grep playlist_dir "${CONFIGFILE}" |head -1|cut -d\
-f4|cut -d/ -f2-) &&
local PLAYLIST="${HOME}/${PLAYLISTDIR}/Recently Added.m3u" &&
# Get the date of the most recently imported files
local ENDDATE=$(beet info -i added -l |grep added|cut -d\ -f2|sort -u|tail
-1) &&
if [[ "${DEBUG}" == "yes" ]]; then
echo ${ENDDATE}
fi &&
# Get the date of 1 week prior
local BEGINDATE=$(date -I -d "${ENDDATE}-7days") &&
if [[ "${DEBUG}" == "yes" ]]; then
echo ${BEGINDATE}
fi &&
# Create a playlist of all files imported between those two dates
beet list -p added:${BEGINDATE}..${ENDDATE} > "${PLAYLIST}" &&
# Modify the playlist to be relative to the Playlist Dir
sed -i.bak "s@${MUSICDIR}@..@g" "${PLAYLIST}"
}
--
You received this message because you are subscribed to the Google Groups
"beets" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.