- it does what mimetypes.get_from_data()
- .tiff is unused (afaik), so don't bother with it
- it is safer to analyze data for mime type (as data may not match provided mime type)
- when images are loaded from audio file tags, a check is done on valid format
- Info dialog Artwork tab now displays types and comment for cover art images
- a tooltip gives info about the source (url, caa url, local file, tag, ...)
======================================================================
ERROR: test_display_tag_name (test.test_utils.TagsTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/travis/build/musicbrainz/picard/test/test_utils.py", line 89, in test_display_tag_name
self.assertEqual(dtn('tag'), 'tag')
File "/home/travis/build/musicbrainz/picard/picard/util/tags.py", line 106, in display_tag_name
return _(name)
NameError: global name '_' is not defined
- fix typo in method name
- make comment more explicit
- test the case where only one element is in the list
- ignore 0 element case (should test skip(), but 2.6 lacks it)
With those changes they can be used to parse plugin API versions too.
Test cases were modified accordingly.
Main changes:
```python
>>> version_from_string("1.0")
(1, 0, 0, 'final', 0)
>>> version_from_string("1.0.1")
(1, 0, 1, 'final', 0)
```
... based on actual knowledge of how characters are used in practice.
low quotation mark -> normal quotation mark rather than comma
oi should be gha -> gh rather than oi
ideographic punctuation, multiplication / division and middle dot are not punctuation
... whose local knowledge of how characters are actually used identified
more appropriate characters to map to.
soft hyphen -> nothing (since it is invisible)
multiplication -> x rather than * (visually closer)
remove duplicate oe
for punctuation, normalization (merging similar looking characters into
the most common one), accents, and full conversion to ascii.
Functions and tests moved into separate files.
Although more comprehensive, the code should run faster because it
eliminates several loops (inc. a loop with two unicodedata references).
This is intended to form the basis of future PRs to:
a. Clean up (simplify) the file naming code
b. Provide script function(s) for cleaning individual tags / file name
parts
c. Add support for translation / transliteration plugins (which I think
make more sense than being included in Picard itself).
d. Support for converting Tags to ISO-8859-1 rather than ascii (since
that is what is supported by ID3 at least)
e. Possible additional options for allowing / preventing normalization,
possible reorganisation of options to centralise all encoding settings
onto one page rather than metadata, tags and file naming pages at
present (to be discussed).
We had a space-separated list of name,value tuples ("Album 0.5 Other 0.4"),
and two helper functions to load and save data in the correct format
(`load_release_type_scores` and `save_release_type_scores`).
Since option is converted to recently-introduced ListOption, data is now saved
as a list of tuples, eventually converted to dict when needed.
It simplifies code, and also prevents an issue if it comes we have a release group type
with a space in its name.
An upgrade hook was added to handle this change on Picard upgrade.
This new class stores the image data in a tempfile.TemporaryFile so we
don't keep the data for all images that are used somewhere in memory
anymore.
It also deals with saving images onto disk when the corresponding tracks
are saved (this was previously done by the File class). This removes the
ability to use tagger script in the cover file name (cf. the first line
of File._make_image_filename).
This new class stores the image data in a tempfile.TemporaryFile so we
don't keep the data for all images that are used somewhere in memory
anymore.
It also deals with saving images onto disk when the corresponding tracks
are saved (this was previously done by the File class). This removes the
ability to use tagger script in the cover file name (cf. the first line
of File._make_image_filename).