diff --git a/picard/coverart/image.py b/picard/coverart/image.py index 69fdd1157..cb036cd47 100644 --- a/picard/coverart/image.py +++ b/picard/coverart/image.py @@ -70,6 +70,9 @@ class DataHash: def __eq__(self, other): return self._hash == other._hash + def hash(self): + return self._hash + def delete_file(self): if self._filename: try: @@ -211,6 +214,11 @@ class CoverArtImage: else: return False + def __hash__(self): + if self.datahash is None: + return 0 + return hash(self.datahash.hash()) + def set_data(self, data): """Store image data in a file, if data already exists in such file it will be re-used and no file write occurs