Commit Graph

366 Commits

Author SHA1 Message Date
Wieland Hoffmann
5391db12e7 Remove unused imports 2019-01-13 10:22:25 +01:00
Laurent Monin
b19d1039ad Fix fake tuple issue again: sys.platform in ("win32") doesn't do what it is meant for 2018-12-16 17:17:47 +01:00
Laurent Monin
b7203e4280 Docstrings should use triple double quotes (PEP257)
https://www.python.org/dev/peps/pep-0257/#id15

For consistency, always use """triple double quotes""" around docstrings.
2018-12-16 16:54:37 +01:00
Philipp Wolfer
4c01a084ff PICARD-490: Support tagging AAC files with APEv2 2018-12-12 10:40:15 +01:00
Philipp Wolfer
6038409d44 PICARD-490: Support load and rename for AAC (ADTS/ADIF) files 2018-12-12 10:40:15 +01:00
Philipp Wolfer
42c4bdf310 Added support for loading and renaming Standard MIDI files 2018-12-12 10:37:52 +01:00
Philipp Wolfer
08165b7b35 Extended tests for script_to_filename 2018-12-11 08:46:02 +01:00
Philipp Wolfer
425c089067 Fixed replacing NULL characters in script_to_filename 2018-12-11 08:40:14 +01:00
Philipp Wolfer
013ea21d47 PICARD-1439: Fix tests for script_to_filename on Windows 2018-12-11 08:34:47 +01:00
Philipp Wolfer
16d567b7b5 PICARD-1439: Unify filename generation by metadata script
Introduce script_to_filename to be used by both file and cover art naming.
2018-12-10 20:39:36 +01:00
Laurent Monin
5daa221547 Run isort -rc to unify imports 2018-11-30 12:50:26 +01:00
Philipp Wolfer
7a359d5786 PICARD-1413: Explicitly mark compilation tag as deleted
Mark compilation tag as deleted if it does not apply instead of sneakily removing it only for ID3.
2018-11-30 12:07:51 +01:00
Philipp Wolfer
82c8a237d2 PICARD-1219: Add tests for existing TIPL / TMCL / IPLS frames being preserved 2018-11-30 00:18:07 +01:00
Philipp Wolfer
93f38db1b9 PICARD-1395: Rename genre related methods in DataObj 2018-11-25 17:08:49 +01:00
Philipp Wolfer
21c2a65c2c PICARD-1395: Rename genre related options and handle config upgrade 2018-11-25 17:08:49 +01:00
Philipp Wolfer
5988bd66ad PICARD-1395: Load MusicBrainz genres 2018-11-25 17:08:49 +01:00
Philipp Wolfer
68d5bb3b33 PICARD-1341: Fix cluster sorting by disc and track number 2018-11-25 11:17:22 +01:00
Philipp Wolfer
b02376d6be Extended format tests for all MusicBrainz identifiers.
Also use more realistic data to catch eventual issues related to string structure or length.
2018-11-24 10:29:41 +01:00
Philipp Wolfer
51d7c82d3f PICARD-1049: Save uppercase TXXX:WORK tag to ID3 2018-11-23 17:52:03 +01:00
Philipp Wolfer
901962838b PICARD-1416: Save uppercase TXXX:ARTISTS tag to ID3 2018-11-23 17:52:03 +01:00
Philipp Wolfer
c8cd00fd7e PICARD-1412: Consider deleted tags as changed 2018-11-14 09:18:15 +01:00
Philipp Wolfer
0431abeeb6 Merge pull request #1028 from phw/PICARD-1338-more-resilient-webservice
PICARD-1338: More resilient webservice
2018-11-13 18:06:38 +01:00
Philipp Wolfer
09e496d5e3 PICARD-1068: Save work tag for MP4 as @wrk 2018-11-13 18:05:44 +01:00
Philipp Wolfer
f90aba2085 Merge pull request #1029 from phw/PICARD-1043-movement
PICARD-1043: Write movement tags
2018-11-12 18:43:19 +01:00
Philipp Wolfer
0546765d5f PICARD-1410: Added test for invalid Vorbis ratings 2018-11-12 09:17:29 +01:00
Philipp Wolfer
2603e6286c Fixed test_api_versions test 2018-11-11 12:08:41 +01:00
Philipp Wolfer
2a54a4962e PICARD-1043: Support movement tags for ID3 and MP4 2018-11-11 11:02:05 +01:00
Philipp Wolfer
bf59d22bbb PICARD-1397: Do not save unsupported tags to files 2018-11-11 10:58:13 +01:00
Philipp Wolfer
3ec9c7c5e4 Merge pull request #1023 from phw/PICARD-637-fix-matchedtracks
PICARD-637: Allow $matchedtracks any number of args
2018-10-31 08:33:46 +01:00
virusMac
8cc47a7680 PICARD-862: Add tests for func_pad, func_replace, func_strip (#1022) 2018-10-31 08:33:02 +01:00
Philipp Wolfer
b18fbc77b2 Added tests for $matchedtracks 2018-10-29 13:34:02 +01:00
virusMac
3310f9914e PICARD-1386: Add $title function (#1018)
PICARD-1386: Add $title function
2018-10-29 08:34:54 +01:00
Philipp Wolfer
f93a44e00b compare_barcodes: Both None and '' are considered "no barcode" 2018-10-25 08:53:53 +02:00
Philipp Wolfer
e94e36eca0 PICARD-1383: Select release with matching barcode on disc ID lookup 2018-10-25 08:53:53 +02:00
Wieland Hoffmann
4efc943246 test_acoustid: Extract self.init_test calls to AcoustIDTests setUp()
This is like 365f55c2 for test_acoustid.
2018-10-23 17:32:50 +02: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
624ba7ff7d Always assign config.setting to a copy of the tests settings dictionary
This prevents any setting from leaking between tests.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
5511bc967c WAVTest: Initialize settings
These tests previously relied on config.setting being initialized by some of the
previous format tests, in particular `enabled_plugins`:

---------------------------------------------------- Captured stderr call -----------------------------------------------------
Traceback (most recent call last):
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 74, in open_
    audio_file = guess_format(filename)
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 58, in guess_format
    for option in options
  File "/home/wieland/dev/picard/picard/formats/__init__.py", line 57, in <listcomp>
    results = [(option._File.score(filename, fileobj, header), option.__name__, option)
  File "/home/wieland/dev/picard/picard/plugin.py", line 130, in __iter__
    enabled_plugins = config.setting["enabled_plugins"]
KeyError: 'enabled_plugins'
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
eebe00a455 PicardTestCase: Reset config.setting in setUp
This helps finding tests that don't explicitly specify all settings they need.
2018-10-23 17:32:50 +02:00
Wieland Hoffmann
dac50a94b3 test_mbjson: Extract self.init_test calls to MBJSONTests setUp()
This is similar to how test_formats does it. It also means that all tests can
inherit setUp() and don't have to super()-call it.
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
Philipp Wolfer
ab576a5bb2 Don't use deprecated U file open mode 2018-10-23 11:15:30 +02:00
Philipp Wolfer
55a6c22548 Fix astrcmp_c unit test not being run 2018-10-18 23:43:24 +02:00
Philipp Wolfer
fce0005eaf PICARD-1376: Fix tag deletion for Ape files
Fixes exception when deleting tags that where not already in the file.
2018-10-16 08:49:44 +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