blob: c726bf22fb6dcde00132348df70b4f0450d47f26 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
#!/bin/bash
local db
if [[ $1 == '--old' ]]; then
db=old_tracks
shift
else
db=yearly_tracks
fi
lastfm_export --user doyster --dsn dbi:SQLite:${HOME}/.tracks.sqlite
for i in $(seq 1 $([ -z "$1" ] && echo 20 || echo $1)); do
echo "select distinct(artist) from $db where artist not in (select distinct(artist) from weekly_tracks);" | sqlite3 ~/.tracks.sqlite | rand_line | sed "s/'/''/" | sed "s/.*/select artist, album from $db where artist = '&' group by artist, album;/" | sqlite3 ~/.tracks.sqlite | rand_line | sed 's/|/ - /'
done
|