mirror of
https://github.com/fergalmoran/picard.git
synced 2026-02-27 10:03:59 +00:00
Allow images with "no type" to match "any type"
This fixes PICARD-1001, which was comparing the following two images: CoverArtImage(url=u'http://ec2.images-amazon.com/images/P/B001BJAG9O.03.LZZZZZZZ.jpg') TagCoverArtImage(u'/mnt/data/music/Amy Macdonald/2007 - This Is the Life [2008]/01 - Mr Rock & Roll.flac', tag='FLAC/PICTURE', types=[u'front'], support_types=True) Which were exactly the same, but the one coming from the release had an empty types, so they were handled as different. This commit makes images with "no type" defined match "any type" (as long as the image data is the same, of course).
This commit is contained in:
@@ -208,7 +208,10 @@ class CoverArtImage:
|
||||
|
||||
def __eq__(self, other):
|
||||
if self and other:
|
||||
return (self.datahash, self.types) == (other.datahash, other.types)
|
||||
if self.types and other.types:
|
||||
return (self.datahash, self.types) == (other.datahash, other.types)
|
||||
else:
|
||||
return self.datahash == other.datahash
|
||||
elif not self and not other:
|
||||
return True
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user