Commit Graph

573 Commits

Author SHA1 Message Date
Philipp Wolfer
c018f076ea PICARD-1739: Use new Version class for version comparison in update check
Fixes update check not properly comparing alpha, beta and rc releases.
2020-02-11 23:03:20 +01:00
Philipp Wolfer
dce902f192 PICARD-1688: Added tests for AcoustID submission 2020-02-11 13:35:04 +01:00
Laurent Monin
0631e5ff28 Move copy_file_tmp() and remove_file_tmp() to PicardTestCase
It helps to reduce code redundancy.
2020-02-08 18:04:39 +01:00
Laurent Monin
64291c309c Use NamedTemporaryFile instead of mkstemp 2020-02-08 18:04:39 +01:00
Laurent Monin
498c8eab1b Add mktmpdir method to PicardTestCase, and use it more widely 2020-02-08 18:04:39 +01:00
Laurent Monin
b7389a6445 Tests: ensure temporary directories and files are removed after tests
- QSettings object needs special care, as file was re-created on exit
- Append a cleanup function as soon as possible to ensure temporary dirs & files are removed in any case
- prefer addCleanup() over tearDown(), keeping creation and cleanup together
2020-02-08 18:04:39 +01:00
Bob Swift
7762f9b929 Add $datetime() function and associated tests 2020-02-07 00:49:35 +01:00
Philipp Wolfer
7c6929286b Apply utime test workaround for all macOS versions.
This also seems not only on the macOS version but also on the Python build being used. On the build server with macOS 10.15 this works with the Python binaries provided on the server, but fails with official binaries from python.org.
2020-02-06 19:55:42 +01:00
Bob Swift
3903007a79 Add $slice() function and associated tests 2020-02-03 14:58:16 -07:00
Bob Swift
761c49124a Add $join() function and associated tests 2020-02-03 12:24:26 -07:00
Philipp Wolfer
d653270b71 PICARD-1723: Consider disc number when comparing metadata
Improves results when matching files to multi-disc albums.
2020-02-03 11:16:52 +01:00
Laurent Monin
52b80593ac Unify new and old script function names
Before introduction of new functions, we had a pattern: "name" script function was defined by "func_name"
Recent patches changed this, introducing inconsistencies.
Also we have inmulti and lenmulti, so stick to this scheme for getmulti and others.

func_find_str -> func_find
find_str -> find
func_reverse_str -> func_reverse
reverse_str -> reverse
func_get_multi -> func_getmulti
func_foreach_multi -> func_foreach
func_while_loop -> func_while
func_map_multi -> func_map
2020-02-01 18:07:38 +01:00
Philipp Wolfer
3d2a5cf250 PICARD-1719: Fix $unset must not mark tags for deletion.
This regressed in Picard 2.2.0 with commit 503b520 and $unset behaves the same as $delete.
2020-01-31 18:09:07 +01:00
Bob Swift
0bea47fcdf Add tests on missing inputs. 2020-01-31 08:20:58 -07:00
Bob Swift
9ac7fd290b Add tests for new functions. 2020-01-30 19:31:41 -07:00
Philipp Wolfer
a9cb192f00 PICARD-1646: Consider release types for AcoustId results
Make the release primary and secondary type as provided by AcoustId available to the matching.
2020-01-29 19:25:36 +01:00
Philipp Wolfer
1799011eb6 PICARD-1715: Add new script_to_filename_with_metadata function
Keep existing script_to_filename function with same behavior as before
2020-01-28 15:14:47 +01:00
Philipp Wolfer
bcc81d86eb PICARD-1715: Allow changing file extension in renaming script 2020-01-28 13:41:27 +01:00
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