diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-09-29 12:58:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-09-29 13:00:43 -0400 |
commit | 89899f01593b86cf3ca491b13f57085e6949577f (patch) | |
tree | 2e213ef1a68940112093af64fd1e7a141a011c99 /aliases | |
parent | c6defed4cf8726b7bc434dbbbb895e6a519a86a3 (diff) | |
download | conf-89899f01593b86cf3ca491b13f57085e6949577f.tar.gz conf-89899f01593b86cf3ca491b13f57085e6949577f.zip |
use the yearly_tracks view i set up
Diffstat (limited to 'aliases')
-rw-r--r-- | aliases | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -107,12 +107,12 @@ function svst { } function pick_music { lastfm_export --user doyster --dsn dbi:SQLite:${HOME}/.tracks.sqlite - sqlite3 ${HOME}/.tracks.sqlite "SELECT artist FROM tracks WHERE strftime('%s') - timestamp < 60*60*24*365 GROUP BY artist ORDER BY count(artist) * (strftime('%s') - max(timestamp)) DESC LIMIT $([ -z "$1" ] && echo 20 || echo $1)" + sqlite3 ${HOME}/.tracks.sqlite "SELECT artist FROM yearly_tracks GROUP BY artist ORDER BY count(artist) * (strftime('%s') - max(timestamp)) DESC LIMIT $([ -z "$1" ] && echo 20 || echo $1)" } function rand_music { 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 tracks where artist not in (select distinct(artist) from weekly_tracks);" | sqlite3 .tracks.sqlite | rand_line | sed 's/.*/select artist, album from tracks where artist = "&" group by artist, album;/' | sqlite3 .tracks.sqlite | rand_line | sed 's/|/ - /' + echo "select distinct(artist) from yearly_tracks where artist not in (select distinct(artist) from weekly_tracks);" | sqlite3 .tracks.sqlite | rand_line | sed 's/.*/select artist, album from tracks where artist = "&" group by artist, album;/' | sqlite3 .tracks.sqlite | rand_line | sed 's/|/ - /' done } function t { |