New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for loading cover art images from local filesystem #408
Conversation
It tries to use image files from directories where files are found. Inspired by http://forums.musicbrainz.org/viewtopic.php?id=2859 Solves: http://tickets.musicbrainz.org/browse/PICARD-137 http://tickets.musicbrainz.org/browse/PICARD-624 Related: http://tickets.musicbrainz.org/browse/PICARD-257
|
||
NAME = "Local" | ||
|
||
_match_re = re.compile('^(?:cover|folder).*\.(?:jpe?g|png|gif|tiff?)$', re.IGNORECASE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"AlbumArt" is also a typical name understood by many software. It's what I am using and it is pretty compatible. I remember switching to this naming for some reason, but I don't remember which software triggered it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in 8e966e4
Images aren't always downloaded.
@@ -117,7 +117,14 @@ class CoverArtImage: | |||
is_front = None | |||
sourceprefix = "URL" | |||
|
|||
def __init__(self, url=None, types=[], comment='', data=None): | |||
def __init__(self, url=None, types=[], comment='', data=None, | |||
from_file=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It took me a while to figure out that from_file
is the filename (so a string) and not a simple boolean. Maybe rename it?
I also wonder why CoverArtImage
needs to know about the possibility of images from files instead of a new LocalCoverArtImage (or something like that) class since we already have {Caa,CaaThumbnail,Tag}CoverArtImage subclasses?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right on both points, i'll improve that.
Reported by Mineo : metabrainz#408 (comment)
Not always a download.
Suggested by Mineo : metabrainz#408 (comment)
Suggested by Mineo : metabrainz#408 (comment)
Examples: cover_back.jpg -> 'back' folder_back,spine.png -> 'spine', 'back' cover_my_title_back_anything.jpg -> 'back'
- list of checkboxes to enable/disabled each provider - re-orderable list items using drag'n'drop, allowing to define which provider should be executed first - save settings for providers order/enabled in one config list option
|
- set a function to be called when 'current' item changes - it may be used to handle per-provider options in UI
… page - Revamp UI, use tabs for provider-specific options - Use regex check to validate the local cover art regex
self.caprovider_caa.setText(_("Cover Art Archive")) | ||
self.caprovider_whitelist.setText(_("Sites on the whitelist")) | ||
self.gb_caa.setTitle(_("Cover Art Archive")) | ||
self.ca_providers_groupbox.setTitle(_("Coverart Providers")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should be "Cover Art Providers" (in ui/options_cover.ui file too)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 2f3816e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- better separation between options of each provider - each provider has its own .ui file for specific options - tabs can be re-ordered by drag'n'drop or using buttons
It adds a cover art provider, which, when enabled, looks for files like cover.jpg, etc.. in local directory (where sound files are) and use image files found as cover art.
Inspired by http://forums.musicbrainz.org/viewtopic.php?id=2859
Solves:
http://tickets.musicbrainz.org/browse/PICARD-137
http://tickets.musicbrainz.org/browse/PICARD-624
Related:
http://tickets.musicbrainz.org/browse/PICARD-257
http://tickets.musicbrainz.org/browse/PICARD-187