summaryrefslogtreecommitdiffstats
path: root/clerk
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-03-11 20:03:39 +0100
committerRasmus Steinke <rasi@xssn.at>2015-03-11 20:03:39 +0100
commit5b5e162dde5d006deb5b111425f2845fd3fa33f8 (patch)
treed1eea9eedcdc7922bd9dc9d4e712f17d3456c9cb /clerk
parent196427bec0326513e9044ecf4da84c9dee22228d (diff)
downloadperl-app-clerk-5b5e162dde5d006deb5b111425f2845fd3fa33f8.tar.gz
perl-app-clerk-5b5e162dde5d006deb5b111425f2845fd3fa33f8.tar.xz
Make ratings import work, even if file structure changed
Diffstat (limited to 'clerk')
-rwxr-xr-xclerk10
1 files changed, 8 insertions, 2 deletions
diff --git a/clerk b/clerk
index 32246af..ff0d83a 100755
--- a/clerk
+++ b/clerk
@@ -317,8 +317,14 @@ restoreTrackRatings () {
mpc clear
cd "${music_path}"
-awk -F "${separator}" '{ print $7 }' **/track.ratings | while read line; do
- mpc add "${line}"
+cat **/track.ratings | while read line; do
+ artist=$(echo "${line}" | awk -F "${separator}" '{ print $2 }')
+ album=$(echo "${line}" | awk -F "${separator}" '{ print $6 }')
+ track=$(echo "${line}" | awk -F "${separator}" '{ print $3 }')
+ title=$(echo "${line}" | awk -F "${separator}" '{ print $4 }')
+ date=$(echo "${line}" | awk -F "${separator}" '{ print $5 }')
+ rating=$(echo "${line}" | awk -F "${separator}" '{ print $1 }')
+ mpc search artist "${artist}" album "${album}" track "${track}" title "${title}" date "${date}" | mpc add
done
mpc playlist -f "%file%" | while read line; do