Commit Graph

555 Commits

Author SHA1 Message Date
Philipp Wolfer
c52519d91a PICARD-239: Handle tags like "comment" and "comment:" the same
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.
2020-01-26 17:07:42 +01:00
Laurent Monin
aefbdb6a73 Move more code from Metadata to external small functions, test them 2020-01-23 18:01:28 +01:00
Laurent Monin
210e71b426 Pass parts to weights_from_release_type_scores() 2020-01-23 18:01:28 +01:00
Philipp Wolfer
8f745f1a0d PICARD-1711: Fix deleting lyrics tag from ASF, APE, ID3 files 2020-01-23 12:10:15 +01:00
Philipp Wolfer
4d85c2e31f PICARD-1589: Support language for ID3 comments.
Adds syntax "comment:{language}:{description}" in addition to existing "comment:{description}" for comment tag names.
2020-01-23 07:57:41 +01:00
Laurent Monin
e44c6929c5 Move code outside Metadata class, to ease testing 2020-01-19 13:51:41 +01:00
Philipp Wolfer
63cb098006 PICARD-34: Fingerprint indicators shows submission status
The fingerprint indicator is shown in red for unsubmitted fingerprints and gray for submitted fingerprints. The tooltip explains the status.
2020-01-13 15:39:54 +01:00
Philipp Wolfer
83de668fdf Refactor Version.to_string and Version.from_string to improve readability 2020-01-03 14:26:40 +01:00
Philipp Wolfer
2f1b6d79da Implement proper version comparison for dev, alpha, beta and rc releases
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).
2020-01-03 14:25:15 +01:00
Philipp Wolfer
95c3689a86 PICARD-1665: Refactoring for detecting user installed plugins 2019-12-31 17:17:54 +01:00
Philipp Wolfer
aa372fbe4c Format short version for alpha, beta and rc according to PEP 440
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.
2019-12-16 08:13:24 +01:00
Philipp Wolfer
ac171c1ed6 Re-add ability to mark alpha, beta and rc pre-release versions
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.
2019-12-16 07:52:01 +01:00
Philipp Wolfer
0855862c8c PICARD-321: Support backslash in filenames on non-Windows OS
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.
2019-12-14 01:03:46 +01:00
Zenara Daley
30fee6e38f PICARD-1521: Add TOFN to ID3 metadata (#1401)
* Add TOFN to ID3 metadata

Co-authored-by: Andrew Wiggins <xandrewwiggins@gmail.com>
Co-authored-by: Wyll Brimacombe <wyll.brimacombe@gmail.com>
Co-authored-by: Raunaq Gupta <raunaqg10@gmail.com>
Co-authored-by: Matt Ehrler <mehrler12@gmail.com>

* Add internal tag name; check for expected value in test

Co-authored-by: Andrew Wiggins <xandrewwiggins@gmail.com>
Co-authored-by: Wyll Brimacombe <wyll.brimacombe@gmail.com>
Co-authored-by: Raunaq Gupta <raunaqg10@gmail.com>
Co-authored-by: Matt Ehrler <mehrler12@gmail.com>
2019-12-09 23:38:22 +01:00
Laurent Monin
e529ee7d71 Test display_tag_name() when name contains multiple double dot separators 2019-12-09 12:48:24 +01:00
Philipp Wolfer
5c2e1eaa0a PICARD-1664: Use preferred release type for cluster lookup 2019-12-02 13:52:13 +01:00
Philipp Wolfer
4dffc55ef1 Merge pull request #1379 from phw/PICARD-1677-ignore-tags
PICARD-1677: Tags can be ignored for metadata comparisson
2019-11-29 17:02:15 +01:00
Philipp Wolfer
4f684d0a48 PICARD-1678: Fix Picard crashing on non-integer search scores
If the search scores returned by the server are not integer values Picard crashed during metadata comparisson.
2019-11-29 17:00:59 +01:00
Philipp Wolfer
c6fcf3f1a0 PICARD-1677: Allow ignoring tags for metadata comparisson
Files that only differ in the tags set in the ignore list will not show up as changed even if those tags have changed.
2019-11-29 15:21:10 +01:00
Philipp Wolfer
a78e857834 isort import sorting fixes 2019-11-26 13:11:08 +01:00
Philipp Wolfer
229116f95a Merge pull request #1306 from phw/PICARD-125-ac3
PICARD-125: Support for raw AC3 / EAC3 files
2019-11-19 09:45:08 +01:00
Philipp Wolfer
a1ea068946 PICARD-1672: Flag MP4 files with the hdvd tag as video 2019-11-18 10:31:44 +01:00
Philipp Wolfer
0e42482f5f PICARD-1662: Do not save too large images to FLAC 2019-11-17 15:42:29 +01:00
Philipp Wolfer
19f6ebc6e1 Fixed deprecation warning in ASF tests 2019-11-13 01:12:29 +01:00
Philipp Wolfer
2c35d76b75 PICARD-1667: Functions for boolean checks must return "" on False 2019-11-12 11:47:42 +01:00
Philipp Wolfer
96ca9188ba PICARD-1406: Make setting data in Metadata consistently use strings
- All Metadata methods setting data (__setitem__, set, add, add_unique) will convert values to strings
- __setitem__ and set are equivalent
2019-11-12 07:55:54 +01:00
Philipp Wolfer
6d5c8df0b4 PICARD-1098: MP4 custom tag names must be valid latin-1 2019-11-04 15:41:35 +01:00
Philipp Wolfer
5318b4c3fe PICARD-1098: Support custom tags for MP4
Custom tags are saved to "----:com.apple.iTunes:REPLAYGAIN_ALBUM_GAIN" + tag_name. tag_name is treated cases insensitive, but casing is preserved.
2019-11-04 15:41:35 +01:00
Philipp Wolfer
0854b91c90 PICARD-1592: Preserve case for APEv2 tags
When reading APEv2 tags case insensitive, preserve existing casing.
2019-11-04 08:18:41 +01:00
Philipp Wolfer
fc432e5ce4 PICARD-1629: Better length calculation for AAC with APEv2
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.
2019-10-31 10:38:18 +01:00
Philipp Wolfer
0776741f5a PICARD-125: AC3 codec is now stored in info.codec 2019-10-28 16:12:45 +01:00
Philipp Wolfer
29a9ee7fd0 PICARD-125: Use AC3 implementation from mutagen
Use a simplified fallback in case mutagen.ac3 is not available.
2019-10-28 16:12:45 +01:00
Philipp Wolfer
99bf0844ef PICARD-125: Read technical details from AC3 files 2019-10-28 16:08:11 +01:00
Philipp Wolfer
0847ee0a35 PICARD-125: Saving tags for AC3 can be configured
Saving APEv2 tags to AC3 can be disabled, existing tags can be removed.
2019-10-28 16:08:11 +01:00
Philipp Wolfer
39843f1f42 PICARD-125: Support AC3 files with APEv2 tags 2019-10-28 15:45:09 +01:00
Philipp Wolfer
ad0c1d88ef PICARD-1628: Make saving APEv2 to AAC optional
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.
2019-10-28 15:38:47 +01:00
Philipp Wolfer
e1688f95ce AAC: Refactored code, moved mutagen specific code to mutagenext 2019-10-28 15:38:47 +01:00
Philipp Wolfer
acb31b7ebe PICARD-1652: Use TAK implementation from mutagen if available
Fallback to our existing more simple implementation.
2019-10-28 08:47:06 +01:00
Philipp Wolfer
965ee9bbce PICARD-1592: APEv2 tag case insensitive reading
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.
2019-10-26 19:34:00 +02:00
Philipp Wolfer
e8a22de919 ASF: Improved error handling for unpack_image
Improvements to unpack_image taken from https://github.com/quodlibet/quodlibet/blob/master/quodlibet/quodlibet/formats/wma.py#L228
2019-10-17 19:02:30 +02:00
Philipp Wolfer
3352e7e86e PICARD-1643: Fixed saving performer tags to Vorbis and APEv2
Tags in the format of performer:instrument were not saved to Vorbis and APEv2 tags if instrument contained non-ASCII characters.
2019-10-16 18:43:36 +02:00
Philipp Wolfer
552051aeb9 PICARD-1260: Sort titles naturally
"Foo 10" should sort after "Foo 2"
2019-10-15 12:21:00 +02:00
Philipp Wolfer
fb20b00418 PICARD-1630: Always save FLAC picture blocks after Vorbis comments
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.
2019-10-14 11:38:03 +02:00
Wieland Hoffmann
47e0b4db0e test_regexfilter: Fix the test
* 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.
2019-10-09 08:23:08 +02:00
Philipp Wolfer
b11b07160d Fixed up left-over Python 2 unicode string declarations 2019-09-26 10:58:54 +02:00
Philipp Wolfer
5fcbb89a0b Fixed typo occured -> occurred 2019-09-25 11:46:58 +02:00
Philipp Wolfer
05ffd72884 tests: use assertIn and assertNotIn 2019-09-13 22:09:36 +02:00
Philipp Wolfer
86835d7916 Merge pull request #1280 from phw/PICARD-456
PICARD-456: Do not remove empty standard directories
2019-09-13 21:06:04 +02:00
Philipp Wolfer
2c05e59f3a Fixed emptydir tests on macOS 2019-09-13 20:30:19 +02:00
Laurent Monin
be7b4d70bb assertEquals() was deprecated in favor of assertEqual() 2019-09-13 19:31:20 +02:00