diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-03-11 20:03:39 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-03-11 20:03:39 +0100 |
commit | 5b5e162dde5d006deb5b111425f2845fd3fa33f8 (patch) | |
tree | d1eea9eedcdc7922bd9dc9d4e712f17d3456c9cb /clerk | |
parent | 196427bec0326513e9044ecf4da84c9dee22228d (diff) | |
download | perl-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-x | clerk | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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 |