Commit Graph

128 Commits

Author SHA1 Message Date
Laurent Monin
abfdbb3ac6 IgnoreUpdatesContext: add on_last_exit and matching tests 2024-05-24 13:46:46 +02:00
Laurent Monin
ef14f46744 IgnoreUpdatesContext: add on_first_enter and matching tests 2024-05-24 13:46:45 +02:00
Laurent Monin
5e499e5dcd Test nested on_exit/on_enter 2024-05-24 13:46:45 +02:00
Laurent Monin
c24c9133e9 IgnoreUpdatesContext: add on_enter and matching test 2024-05-24 13:46:45 +02:00
Laurent Monin
b60d98febe IgnoreUpdatesContext: onexit -> on_exit 2024-05-24 13:46:45 +02:00
Philipp Wolfer
5f76d9285c Always detect_file_encoding ASCII as UTF-8
This ensures partially analyzed documents that are detected as ASCII
but contain UTF-8 encodings later in the file still get loaded. Also
it standardizes charset detection between chardet and charset_normalizers,
which previously differed on the \00 test case.
2024-04-30 11:38:49 +02:00
Laurent Monin
10d2992253 import _ -> import gettext as _ 2024-04-22 10:42:49 +02:00
Laurent Monin
fada4f0a40 Import gettext-related methods, instead of monkeypatching builtins 2024-04-21 23:24:03 +02:00
Philipp Wolfer
3cc33b5516 Fix tests for detect_file_encoding without charset-normalizer installed 2024-03-23 17:47:42 +01:00
Philipp Wolfer
06ae9d7de9 Fixed utf-32 detection from BOM
- the utf-32-le BOM was in wrong order
- longer BOMs need to be checked first
- added BOM for utf-8-sig
2024-03-23 17:47:42 +01:00
ShubhamBhut
6a3e7b083a PICARD-2716: Accept encodings other than utf-8 when opening CD extraction logs 2024-03-14 08:44:49 +01:00
Philipp Wolfer
3280370728 PICARD-2331: Remove get_qt_enum
As PyQt's enums are now proper Python enums this is no longer needed
2023-10-13 07:13:21 +02:00
Philipp Wolfer
7d55ae5e5d PICARD-2331: Upgrade to PyQt6 2023-10-13 07:10:06 +02:00
Laurent Monin
cf3013a353 Make get_qt_enum() a generator and extend tests 2023-10-02 14:02:10 +02:00
Philipp Wolfer
c965eff013 Additional tests for win_prefix_longpath 2023-09-26 15:13:10 +02:00
Philipp Wolfer
31a5d273de Use raw strings to avoid double backslashes in Windows path strings 2023-09-18 12:03:16 +02:00
Philipp Wolfer
d211e7464d PICARD-2756: Fix long path support for Windows UNC (network) paths 2023-09-18 12:03:16 +02:00
Philipp Wolfer
ddda49c6ff PICARD-2712: Fix sanitize date removing 0 values
Sanitize date cleared zero values in between, such turning "YYYY-00-DD"
into "YYYY-DD", which would be a completely different date.

Fix this by keeping empty values if they are not the last element.
2023-08-17 10:14:45 +02:00
Laurent Monin
944a92eecd Add an helper method to encode query arguments: encoded_queryargs() 2023-06-08 16:44:15 +02:00
Philipp Wolfer
cb339c6a4a PICARD-356: Allow user defined replacements for Windows incompatible characters 2022-12-05 17:08:56 +01:00
Laurent Monin
b12198189b Remove duplicated line in dict 2022-09-25 14:45:54 +02:00
Philipp Wolfer
bee8b569e3 Move detect_unicode_encoding function to picard.util
Extract the function from ripper log file handling and make it available in picard.util.
2022-09-25 12:14:51 +02:00
Philipp Wolfer
224096df0b PICARD-2520: Null bytes in tag values can cause crashes when sorting
strxfrm fails if a string contains a null char. Sanizize the input strings for strxfrm by removing any null chars.
2022-08-19 13:31:21 +02:00
Philipp Wolfer
277e943e5c PICARD-2506: Fixed calling fpcalc with long path filename
On Windows always add the long path prefix \\?\ if the path exceeds this limit, independent of the OS configuration for long path supports. This fixes ffmpeg currently not being able to handle long paths.

Added util method win_prefix_longpath() to help with that.
2022-06-26 18:13:58 +02:00
Philipp Wolfer
70b07bc570 PICARD-2454: Stop metadatabox updates while moving files 2022-04-09 18:26:59 +02:00
Philipp Wolfer
aaee5e4f37 PICARD-993: Have different error icons for different file errors
Separate icons for file not found, access denied and anything else
2022-03-12 10:28:42 +01:00
Philipp Wolfer
0ff523db9d PICARD-2076: Added tests for picard.util.system_supports_long_paths 2022-03-08 15:21:00 +01:00
Philipp Wolfer
718875177b PICARD-2076: Use Windows long path prefix only, if long paths are unsupported 2022-03-08 14:00:24 +01:00
Philipp Wolfer
c04f143274 PICARD-1570: Allow loading files with long paths on Windows 2022-03-07 11:18:49 +01:00
Philipp Wolfer
e1c6234dd7 Have find_best_match and sort_by_similarity accept any iterable 2022-02-17 08:18:26 +01:00
Philipp Wolfer
8b8593b546 PICARD-2414: Added some additional tests for tracknum_and_title_from_filename
Test some more real world examples and ignore cases like UB40 where a no. follows directly on alphanumeric characters.
2022-02-11 11:01:33 +01:00
Laurent Monin
2f6479747d Update headers 2022-02-07 09:41:57 +01:00
Philipp Wolfer
9e740c11a4 Omit standard ports in URLs constructed by build_qurl 2022-01-31 07:49:21 +01:00
Philipp Wolfer
76975ae108 Have album_artist_from_path strip the Windows drive letter 2021-11-23 19:24:10 +01:00
Laurent Monin
55eae2d5a4 find_best_match(): use max() instead of sort_by_similarity()
- drop unused `num_results` from `BestMatch` namedtuple
- use `max()` along its `key` and `default` arguments, it is much simpler and faster
2021-11-16 21:37:48 +01:00
Laurent Monin
14ce07756e Update Copyright headers, with the help of fix-headers.py script 2021-11-10 21:38:54 +01:00
Philipp Wolfer
a01f28d0c0 PICARD-2327: Detect hidden files on macOS 2021-11-10 08:02:50 +01:00
Philipp Wolfer
10caa13975 Add Windows specific unit test for util.is_hidden 2021-11-09 20:58:17 +01:00
Philipp Wolfer
cd559a1011 Extend wildcard to regex syntax with [...] set matching 2021-10-14 22:58:04 +02:00
Philipp Wolfer
f20da2d9aa Extend wildcard to regex syntax with ? and escape character 2021-10-14 22:58:03 +02:00
Bob Swift
e8aa0b3cd6 Add weighted script detector and multiple translation ignore options 2021-09-08 11:58:24 -06:00
Vladislav Karbovskii
7224961bc4 PICARD-157: Option to skip artist name translation for specific scripts
Add a dropdown to select a script for which artist translation will be skipped.

Co-authored-by: Laurent Monin <github@norz.org>
Co-authored-by: Bob Swift <bswift@rsds.ca>
2021-09-06 12:00:01 +02:00
Bob Swift
bfc0ac3ae5 Move make_filename_from_title to picard/util. Add tests. 2021-08-03 12:03:17 -06:00
Laurent Monin
ab54651438 Update headers 2021-06-03 13:20:42 +02:00
Laurent Monin
a4a6508b2f tracknum_and_title_from_filename(): return a named tuple 2021-06-03 13:02:46 +02:00
Philipp Wolfer
0209b5ed28 PICARD-2218: Support setting regex flags in $performer pattern 2021-06-02 23:18:45 +02:00
Philipp Wolfer
f94004763b Add picard.util.pattern_as_regex to parse string patterns as regular expressions
Replace the custom implementation of pattern parsing in TagGenreFilter with pattern_as_regex
2021-06-02 23:02:47 +02:00
Philipp Wolfer
ef62e311dd PICARD-1568: extended tests for tracknum_from_filename
Include most of the tests from test_tracknum.py. Changed a few tests as we got rid of the logic to choose the smallest of all numbers found.
2021-05-01 20:50:24 +02:00
Philipp Wolfer
19d973c36d PICARD-1568: Improve parsing track number from filenames
Avoid false positives, allow some common cases only instead of parsing all numbers.
2021-05-01 20:50:24 +02:00
Philipp Wolfer
ff58985305 PICARD-2171: Added tests for guessing tracknumber and title from filename 2021-04-28 10:51:58 +02:00