diff options
author | Rasmus Steinke <rasi@xssn.at> | 2014-08-25 01:06:20 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2014-08-25 01:06:20 +0200 |
commit | ffc7dcfd86a813ff402c7d3c5e2ec6a506dd3c89 (patch) | |
tree | ad7462836532218f6e7e6ac6854210f9e97751d1 | |
parent | 7e72a29491bd93767a38ab7d3cc1ecb5d4e6c9c0 (diff) | |
download | perl-app-clerk-ffc7dcfd86a813ff402c7d3c5e2ec6a506dd3c89.tar.gz perl-app-clerk-ffc7dcfd86a813ff402c7d3c5e2ec6a506dd3c89.tar.xz |
temporary recreate database on each update
-rw-r--r-- | clerk | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -173,9 +173,8 @@ ratingPrompt () { "7 Maximum Albums Rating: $(echo $maxratings)" "8 Maximum Tracks Rating: $(echo $track_maxratings)" "9 Create/Update Database" - "0 Delete Database (Can be recreated)" "---" - "F Love current Song on LastFM") + "0 Love current Song on LastFM") prompt() { printf "%s\n" "$@" | dmenu_t -p "Ratings > " @@ -191,8 +190,7 @@ ratingPrompt () { 7*) optionsRatingPrompt ;; 8*) optionsTrackRatingPrompt ;; 9*) updateDB;; - 0*) killDB ;; - F*) lastfm-mpd-cli love > /dev/null && notify-send "MPD" "Loved $(mpc current -f '%title%') on LastFM" ;; + 0*) lastfm-mpd-cli love > /dev/null && notify-send "MPD" "Loved $(mpc current -f '%title%') on LastFM" ;; Q*) dplayPrompt ;; *) exit esac @@ -200,11 +198,7 @@ ratingPrompt () { updateDB () { cd $HOME/.config/clerk/ratings - if [[ -a ratings.db ]]; then - echo "using existing database" - else - sqlite3 ../ratings.db < /usr/share/doc/clerk/create_rating.sql - fi + rm -f ../ratings.db for line in *.ratings; do artist=$(grep "^artist=" "$line" | cut -d '=' -f2- ) date=$(grep "^date=" "$line" | cut -d '=' -f2-) |