Commit Graph

7535 Commits

Author SHA1 Message Date
Laurent Monin
ee6a16185d Remove useless tests 2019-03-04 21:49:31 +01:00
Laurent Monin
5bb460dac5 Use heap instead of list+sort, as we only care best result 2019-03-04 21:49:31 +01:00
Laurent Monin
de3dbbbeb4 Rework File._move_additional_files()
- use faster os.scandir() (since python 3.5)
- change the logic so we don't build list of all files but only list of files to move
- handle OSError, a file or directory could be removed during the process, or have permissions changed
- log such errors
2019-03-04 21:48:07 +01:00
Laurent Monin
bd7b471416 Test File.move_additional_files() for hidden files cases
In case patterns start with a dot we don't ignore hidden files
It was implemented in https://github.com/metabrainz/picard/pull/519
2019-03-04 21:48:07 +01:00
Laurent Monin
8d5efd4c09 Cache self.cluster_dict.get_token(y).lower() calculation 2019-03-04 21:46:17 +01:00
Laurent Monin
fbd5491376 ClusterDict.add(): tokenize only if needed 2019-03-04 21:46:17 +01:00
Laurent Monin
dc035f951f Lower word once 2019-03-04 21:46:17 +01:00
Laurent Monin
b86a687e15 Use defaultdict for words and ids properties and simplify code 2019-03-04 21:46:17 +01:00
Laurent Monin
702c4b7ca3 Remove unused print/debug method printCluster() 2019-03-04 21:46:17 +01:00
Laurent Monin
197f1e1b24 Use super() instead of parent class name 2019-03-04 21:46:17 +01:00
Laurent Monin
1f14c19a35 getSize -> get_size 2019-03-04 21:46:17 +01:00
Laurent Monin
0f54eab991 getWord -> get_word 2019-03-04 21:46:17 +01:00
Laurent Monin
771a2339a3 getToken -> get_token 2019-03-04 21:46:17 +01:00
Laurent Monin
841c8acbfc getWordAndCount -> get_word_and_count 2019-03-04 21:46:17 +01:00
Laurent Monin
9a5dcd83dd getClusterTitle -> get_cluster_title 2019-03-04 21:46:17 +01:00
Laurent Monin
e97cdaef00 getClusterFromId -> get_cluster_from_id 2019-03-04 21:46:17 +01:00
Laurent Monin
9980b7c5ff idClusterIndex -> index_id_cluster 2019-03-04 21:46:17 +01:00
Laurent Monin
5bb5f49935 clusterBins -> cluster_bins 2019-03-04 21:46:17 +01:00
Laurent Monin
00299aeb9e clusterCount -> cluster_count 2019-03-04 21:46:17 +01:00
Laurent Monin
d44a9b56dc clusterDict -> cluster_dict 2019-03-04 21:46:17 +01:00
Laurent Monin
ad12f57a55 Cleanup 2019-03-04 21:46:17 +01:00
Laurent Monin
836eea6f97 Make Album._match_files() a generator 2019-03-04 21:45:50 +01:00
Laurent Monin
372981f535 Move tracks cache building to its own method, code is easier to read 2019-03-04 21:45:50 +01:00
Laurent Monin
3fe73bc3ea Simplify code even more 2019-03-04 21:45:50 +01:00
Laurent Monin
799181dcb5 Rework Album.match_files()
- use simple comparaison and last best match instead of list + sort
- drop unused use_recordingid parameter
- split the method in two, it should ease testing
- drop match_file, and use modified match_files, reducing code redundancy
2019-03-04 21:45:50 +01:00
Laurent Monin
79eedc20e6 Add debug output for each case 2019-03-04 21:03:56 +01:00
Laurent Monin
f960dd8115 Simplify code using a bunch of return
Those if/elif were hard to read and lead to code duplication
2019-03-04 21:03:56 +01:00
Laurent Monin
498af86aa4 Make the code slightly easier to read 2019-03-04 21:03:56 +01:00
Laurent Monin
6e412f0835 No need of recordingid if option ignore_file_mbids is set 2019-03-04 21:03:56 +01:00
Laurent Monin
7538bb4a96 No need of recordingid if target is set 2019-03-04 21:03:56 +01:00
Laurent Monin
8a36cd5139 Drop useless code
This shouldn't be needed since b36d88ad46
2019-03-04 21:03:56 +01:00
Laurent Monin
8bc9cf9886 Reduce indentation level 2019-03-04 21:03:56 +01:00
Laurent Monin
beb6d94f95 Fix mbid_validate()
- drop dependency on string.Template, the regex is very simple
- test against None, as per documentation
- fix the match when the string is starting with a valid mbid but is too long
- use case-insensitive matching flag
2019-03-04 19:35:05 +01:00
Laurent Monin
1ca043dd90 Add tests for mbid_validate() 2019-03-04 19:35:05 +01:00
Laurent Monin
c948e01400 tagger.analyze(): immediatly return if acoustid is disabled
- code was setting files as pending before testing if acoustid was enabled
- test can be done before anything since that's a required condition
2019-03-04 18:26:51 +01:00
Laurent Monin
81118d0954 Set version to 2.2.0dev1 2019-03-04 17:36:11 +01:00
Laurent Monin
5b3e83120d Bump version to 2.1.3 2019-03-04 17:31:14 +01:00
Laurent Monin
1f95f05645 Resync po files 2019-03-04 17:31:14 +01:00
Laurent Monin
b66d7999d2 Merge pull request #1112 from phw/PICARD-455-flac-set-image-dimensions
PICARD-455: Set dimensions for images saved to FLAC
2019-02-27 14:14:20 +01:00
Philipp Wolfer
a9709f97ea PICARD-455: Set dimensions for images saved to FLAC 2019-02-27 08:29:23 +01:00
Philipp Wolfer
fb88867dd1 PICARD-1468: Localize NSIS installer
Use default NSIS languages and extract all custo UI strings into language files.
2019-02-23 17:37:26 +01:00
Philipp Wolfer
56f0e05a21 PICARD-1468: Enable default translation in NSIS installer
Include all languages we currently also support inside Picard.
2019-02-23 17:15:24 +01:00
Laurent Monin
9db6d8e0d9 Update pot file 2019-02-22 22:48:35 +01:00
Philipp Wolfer
ccebf9c8b9 Refactored local cover art class
Generalized the handling of cover art URLs to also handle file:// scheme.
2019-02-22 14:14:00 +01:00
Laurent Monin
710f1ac8ef Merge pull request #1110 from zas/clearlineedit
PICARD-1480: Remove unneeded ButtonLineEdit
2019-02-22 13:27:43 +01:00
Laurent Monin
c4a63a8772 Remove unneeded ButtonLineEdit
QLineEdit has a clearButtonEnabled property since 5.2 which is meant for this purpose.
It also fixes an issue with clear button icon size
2019-02-22 11:46:24 +01:00
Philipp Wolfer
ecf8ad565a PICARD-1178: Support comparing cover images with only one type
All our current tags support either no or only one type.
Fixes issues where files where shown as modified when loading again and comparing against cover art with more than one type.
2019-02-22 11:05:08 +01:00
Philipp Wolfer
a10c7a01fc Updated POT file 2019-02-21 13:32:00 +01:00
Philipp Wolfer
b4664f6649 Merge pull request #1108 from phw/PICARD-729-nat-error-handling
PICARD-729: NAT error handling
2019-02-21 13:30:43 +01:00
Philipp Wolfer
1c3f1e23cc PICARD-729: Show error icon if NAT fails loading 2019-02-21 13:29:27 +01:00