Commit Graph

7535 Commits

Author SHA1 Message Date
Laurent Monin
5cddf67313 CoverArtImage.desc -> CoverArtImage.comment 2014-05-08 09:00:01 +02:00
Laurent Monin
f086ccb1e9 _queue_image_from_caa() -> _queue_from_caa() 2014-05-08 08:04:26 +02:00
Laurent Monin
90faeb9fd4 Move code to new _queue_from_cover_art_relation()
Consistency.
2014-05-08 08:02:06 +02:00
Laurent Monin
2b94c71348 _process_asin_relation() -> _queue_from_asin_relation() 2014-05-08 07:57:59 +02:00
Laurent Monin
1fe8c708a4 message() -> _message() 2014-05-08 07:56:46 +02:00
Laurent Monin
91f1baf8dd Move message() and _xmlws_download() 2014-05-08 07:55:05 +02:00
Laurent Monin
adc014eae1 Move _process_asin_relation() near its caller 2014-05-08 07:53:08 +02:00
Laurent Monin
14aef163b6 Add methods descriptions + minor tidy up 2014-05-07 18:02:12 +02:00
Laurent Monin
d1e08001d5 Move part of code from retrieve() to new _has_caa_artwork() 2014-05-07 18:01:13 +02:00
Laurent Monin
1dddba9029 _append_caa_image() -> _queue_image_from_caa() 2014-05-07 18:01:13 +02:00
Laurent Monin
e881e09003 _fill_from_relationships() -> _queue_from_relationships() 2014-05-07 18:01:13 +02:00
Laurent Monin
50db339a84 _walk() -> _download_next_in_queue()
Better match what it does.
2014-05-07 18:01:13 +02:00
Laurent Monin
a9199b4911 _download() -> _xmlws_download()
This is a wrapper to the actual call to album.tagger.xmlws.download()
2014-05-07 18:01:13 +02:00
Laurent Monin
80ed1d7265 Do not hide errors that are actually errors
Use Album.error_append() instead of log.debug()
2014-05-07 18:01:13 +02:00
Laurent Monin
8677a4aa3d Hide underlying queue/list using a bunch of new methods
- _append_image() -> _queue_put()
- new _queue_get()
- new _queue_empty()
- new _queue_new()
2014-05-07 18:01:13 +02:00
Laurent Monin
6d68b9f00b try_list -> queue + fix up few comments 2014-05-07 18:01:13 +02:00
Laurent Monin
f2a0c1b2cd Modify how we skip unneeded front images from non-CAA sources
Instead of looping and modify the try list, just check in _walk()
and continue.
Improve debugging messages (no more silent removal in debug mode).
2014-05-07 18:01:13 +02:00
Laurent Monin
af405b1baa Improve debug messages 2014-05-07 18:01:13 +02:00
Laurent Monin
b79149f843 Improve handling of multiple image types and is_front flag
- convert type-as-a-string to list of types
- display concatenated list of types in messages (ie. back,spine)
- pass is_front flag everywhere needed
- pass list of types instead of single string everywhere needed
- introduce maintype() method to get the first type if more than one is set
- in formats/*, use types_and_front() at read time to get properly formatted list of types (only one element for now, since no format seems to support multiple types)
- use Image.maintype() at write time (since no format supports multiple types for now)
2014-05-07 18:01:13 +02:00
Laurent Monin
7de9477b7b Add types_and_front() helper function
- it converts id3 type to CAA-like type list
- it returns a is_front boolean, emulating CAA flag
2014-05-07 18:01:13 +02:00
Laurent Monin
7a1607e8c3 Remove useless import 2014-05-07 18:01:13 +02:00
Laurent Monin
5b5ca9a481 Add image description to debug message if available 2014-05-07 18:01:12 +02:00
Laurent Monin
73c57108f6 Use an explicit is_front property for CAA front flag indicator 2014-05-07 18:01:12 +02:00
Laurent Monin
d5b4bfec91 Subclass CoverArtImage and add support_types property
- CaaCoverArtImage is only used for CAA images
- drop host comparaison (vs 'archive.org'), use a much cleaner "flag"
- all current providers but CAA don't support multiple types, so we defaults to a "front" type
- once we have one image from one of those providers we are done
- we don't want to remove all images from CAA having front type
2014-05-07 18:01:12 +02:00
Laurent Monin
67c9225767 Use types intersection to select caa images to download, clarify code
- lowercase types from json, to match lowercased types from options
- fix up logic concerning caa_front_found
- add few comments and debug info
2014-05-07 18:01:12 +02:00
Laurent Monin
46649c6332 Drop useless coverartobj argument, cleanup 2014-05-07 18:01:12 +02:00
Laurent Monin
3a4f062694 _coverart_downloaded(): better handling of not enough data case
At least log a message in debug mode in this case.
Btw, i'm not sure why this condition was added, even if it makes sense.
2014-05-07 18:01:12 +02:00
Laurent Monin
825abdda5d _fill() -> _fill_from_relationships() 2014-05-07 18:01:12 +02:00
Laurent Monin
2df6c9759e _walk(): reduce indentation level 2014-05-07 18:01:12 +02:00
Laurent Monin
4ea310c983 _process_asin_relation(): reduce indentation level 2014-05-07 18:01:12 +02:00
Laurent Monin
cdec8f4e92 No need to calculate length of the list to test if empty. 2014-05-07 18:01:12 +02:00
Laurent Monin
e31d77f8d5 Wraps self.album.tagger.xmlws.download() in new _download() method 2014-05-07 18:01:12 +02:00
Laurent Monin
a43569755d Introduce CoverArtImage class and simplify code
- move is_front_image() from metadata.py to class CoverArtImage as it is only used here
2014-05-07 18:01:12 +02:00
Laurent Monin
f7bf4acfa1 Pass url as text to _append_image_url() instead of QUrl object 2014-05-07 18:01:12 +02:00
Laurent Monin
c5efe95ff0 Wrap QObject.tagger.window.set_statusbar_message() in new message() class method 2014-05-07 18:00:58 +02:00
Laurent Monin
84ffb3f32c imagedata -> image 2014-05-07 17:35:03 +02:00
Laurent Monin
0908b0e6c9 _caa_append_image_to_trylist() -> _append_caa_image() 2014-05-07 17:35:03 +02:00
Laurent Monin
b5625207c4 Tidy up, PEP8 conformance 2014-05-07 17:35:03 +02:00
Laurent Monin
139ab5b1e8 Store accepted CAA types and number of them in class properties 2014-05-07 17:35:02 +02:00
Laurent Monin
f3edf6cefe Drop '_try_list' prefix/suffix and shorten method names 2014-05-07 17:35:02 +02:00
Laurent Monin
6cdecc328e Convert release argument to class property 2014-05-07 17:35:02 +02:00
Laurent Monin
7ab4677a4e Move _coverart_http_error() to class CoverArt 2014-05-07 17:35:02 +02:00
Laurent Monin
d6cd3eb467 Convert metadata argument to class property 2014-05-07 17:35:02 +02:00
Laurent Monin
007c30dd21 Convert album argument to class property 2014-05-07 17:35:02 +02:00
Laurent Monin
48bd904cf8 Move coverart_init() code to __init__() 2014-05-07 17:35:02 +02:00
Laurent Monin
d2744cae02 Convert most functions to class methods 2014-05-07 17:35:02 +02:00
Laurent Monin
7b65ec2e50 Move class CoverArt and coverart() at end of the file 2014-05-07 17:35:02 +02:00
Laurent Monin
c04ffeed9e Move most code from coverart() to new coverart_init() 2014-05-07 17:35:02 +02:00
Laurent Monin
7a1e01006f Re-order _coverart_downloaded() arguments, place coverartobj first 2014-05-07 17:35:02 +02:00
Laurent Monin
3287546f00 Re-order _caa_json_downloaded() arguments, place coverartobj first 2014-05-07 17:35:02 +02:00