Some of Picard's tag names allow an additional description separated by a colon, e.g. "comment:desc". In case the description part is empty and the tag ends on a colon this is now treated the same as without any colon. So "lyrics" and "lyrics:" are the same tag.
Handling this in Metadata makes this change immediately available in scripting and to all formats. Script using both forms will still work.
The version identifier was previously compared alphabetically, which fails for e.g. "dev" < "alpha".
Implement proper version comparison by introducing a Version class (inherited from tuple).
This omits the dot before the version identifier. Avoids setuptools warning about version normalization for alpha, beta and rc versions.
Note that it is still ".dev1", this is also according to PEP 440.
For Picard versions support the version identifiers 'alpha', 'beta' and 'rc' again (in addition to 'final' and 'dev'). This used to be supported, but got lost at some point
Long version strings will be e.g. 2.3.0beta2. If the shortened string is generated the idenfitiers for alpha and beta will be shortened to 'a' and 'b' (e.g. 2.3.0b2). This confirms to pre-release versioning is defined in PEP 440.
With this change backslashes can be used in filenames on systems other than Windows. Only if Windows compatibility is activated backslashes will be replaced as before.
For AAC files with APEv2 tags the length calculation was off, since the size of the APEv2 block was used in the estimate. Now the length of the APEv2 block gets taken out of the length estimate.
Only some software supports APEv2 tags in AAC files, for some software it even causes issues with length calculation or playback. Let the user configure whether to save APEv2 to AAC, not save APEv2 to AAC or completely remove APEv2 from AAC.
According to specification APEv2 tags should be read case insensitive. Previously Picard only read tags for which there was no explicit mapping case insensitive, but treated all explicitly mapped tags case sensitive.
If FLAC picture blocks are located before the Vorbis comments, Windows cannot read the tags. By ensuring the pictures are always located after the Vorbis comments the FLAC metadata will be visible and editable in Windows Explorer.
* only repeats the preceding regular expression, but in the old test, there was
nothing preceding it. This showed up when tests were executed via `python
setup.py test`:
> .........................................E: 20:54:38,617 /home/wieland/dev/picard/picard/track.__init__:88: Failed to compile regex /*/: nothing to repeat at position 0
> Traceback (most recent call last):
> File "/home/wieland/dev/picard/picard/track.py", line 86, in __init__
> regex_search = re.compile(remain, re.IGNORECASE)
> File "/usr/lib/python3.7/re.py", line 234, in compile
> return _compile(pattern, flags)
> File "/usr/lib/python3.7/re.py", line 286, in _compile
> p = sre_compile.compile(pattern, flags)
> File "/usr/lib/python3.7/sre_compile.py", line 764, in compile
> p = sre_parse.parse(p, flags)
> File "/usr/lib/python3.7/sre_parse.py", line 930, in parse
> p = _parse_sub(source, pattern, flags & SRE_FLAG_VERBOSE, 0)
> File "/usr/lib/python3.7/sre_parse.py", line 426, in _parse_sub
> not nested and not items))
> File "/usr/lib/python3.7/sre_parse.py", line 651, in _parse
> source.tell() - here + len(this))
> re.error: nothing to repeat at position 0
This was swallowed by py.test's behaviour to swallow stdout & stderr if no tests
fail.
Remove `*` from test_regexfilter and add an additional test with `/.*/` to
ensure this works.
The genre filter UI handled this correctly by showing the re.error in the UI.