Commit Graph

10 Commits

Author SHA1 Message Date
Philipp Wolfer
ecf8ad565a PICARD-1178: Support comparing cover images with only one type
All our current tags support either no or only one type.
Fixes issues where files where shown as modified when loading again and comparing against cover art with more than one type.
2019-02-22 11:05:08 +01:00
Wieland Hoffmann
5391db12e7 Remove unused imports 2019-01-13 10:22:25 +01:00
Wieland Hoffmann
e624aa121c Make PicardTestCase the parent class of all tests
This brings the faketagger and, more importantly, settings reset to all of them.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
f01f9299a9 Extract setting up a FakeTagger into a PicardTestCase class 2018-10-23 17:32:50 +02:00
Wieland Hoffmann
3c366c7e36 test_imagelist: Fulfill the assumption that QObject.tagger is a FakeTagger object
Previously, these tests were failing if executed before test_filesystem or
test_format which already did the same:

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
test/test_imagelist.py:25: in create_test_files
    CoverArtImage(url='file://file1', data=create_fake_png(b'a')),
picard/coverart/image.py:151: in __init__
    self.set_data(data)
picard/coverart/image.py:248: in set_data
    self.datahash = DataHash(data, suffix=self.extension)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <picard.coverart.image.DataHash object at 0x7f367fe036a0>
data = b'\x89PNG\r\n\x1a\naaaaIHDR\x00\x00\x00d\x00\x00\x00da', prefix = 'picard', suffix = '.png'

    def __init__(self, data, prefix='picard', suffix=''):
        self._filename = None
        _datafile_mutex.lock()
        try:
            m = md5()
            m.update(data)
            self._hash = m.hexdigest()
            if self._hash not in _datafiles:
                (fd, self._filename) = tempfile.mkstemp(prefix=prefix, suffix=suffix)
>               QObject.tagger.register_cleanup(self.delete_file)
E               AttributeError: type object 'QObject' has no attribute 'tagger'

picard/coverart/image.py:68: AttributeError
2018-10-23 17:32:50 +02:00
Laurent Monin
6fe07b45ae Removed a bunch of unused imports 2018-10-11 14:34:26 +02:00
Philipp Wolfer
a4f2cd8a89 PICARD-1339: Added add_metadata_images function 2018-10-06 09:58:43 +02:00
Philipp Wolfer
ab2778a521 PICARD-1339: Use remove_metadata_images for Album and Track 2018-10-06 09:58:43 +02:00
Philipp Wolfer
bc9c9ba602 PICARD-1339: WIP Added optimized imagelist.remove_metadata_images 2018-10-06 09:58:43 +02:00
Philipp Wolfer
a68e76a4b7 PICARD-1339: Added unitttest for update_metadata_images 2018-10-06 09:58:43 +02:00