diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-03-13 18:27:19 +0100 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-03-13 18:27:19 +0100 |
commit | 8d9513339dd7228da83d55168b1c76ec9ede9d60 (patch) | |
tree | 5514f8bf3a1a38148a9899b1cce9c2f68c55de0e /clerk_helper | |
parent | b561148ff4463cc897eddb169c56f3044bd9a6f2 (diff) | |
download | perl-app-clerk-8d9513339dd7228da83d55168b1c76ec9ede9d60.tar.gz perl-app-clerk-8d9513339dd7228da83d55168b1c76ec9ede9d60.tar.xz |
work around for album ratings too
Diffstat (limited to 'clerk_helper')
-rwxr-xr-x | clerk_helper | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clerk_helper b/clerk_helper index 82c1a82..4351f6d 100755 --- a/clerk_helper +++ b/clerk_helper @@ -172,9 +172,20 @@ def restoreAlbumRating(args): for song in matches: ratingfile = open(song, 'r') for line in ratingfile: + tag = [] tags = line.split(os.environ['separator']) - album = tags[5].rstrip('\n') - client.findadd('artist', tags[1], 'album', album, 'track', tags[2], 'title', tags[3], 'date', tags[4]) + for x in tags: + if isinstance(x, list): + tag.append(x[0].rstrip('\n')) + else: + tag.append(x) + rating = tag[0] + artist = tag[1] + track = tag[2] + title = tag[3] + date = tag[4] + album = tag[5].rstrip('\n') + client.findadd('artist', artist, 'album', album, 'track', track, 'title', title, 'date', date) for song in client.playlistinfo(): ratingfile = open(config['global']['music_path']+"/"+os.path.dirname(song['file'])+'/album.rating', 'r') |