mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-22 23:55:46 +00:00
Fix error when POPM frame has no count attribute.
This commit is contained in:
@@ -268,11 +268,12 @@ class ID3File(File):
|
||||
# Search for an existing POPM frame to get the current playcount
|
||||
for frame in tags.values():
|
||||
if frame.FrameID == 'POPM' and frame.email == settings['rating_user_email']:
|
||||
count = frame.count
|
||||
try: count = frame.count
|
||||
except AttributeError: count = 0
|
||||
break
|
||||
else:
|
||||
count = 0
|
||||
|
||||
|
||||
# Convert rating to range between 0 and 255
|
||||
rating = int(values[0]) * 255 / (settings['rating_steps'] - 1)
|
||||
tags.add(id3.POPM(email=settings['rating_user_email'], rating=rating, count=count))
|
||||
|
||||
Reference in New Issue
Block a user