Skip to content
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

Closed
wants to merge 32 commits into from

Conversation

zas
Copy link
Collaborator

@zas zas commented Jun 24, 2015

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


NAME = "Local"

_match_re = re.compile('^(?:cover|folder).*\.(?:jpe?g|png|gif|tiff?)$', re.IGNORECASE)
Copy link
Member

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added in 8e966e4

@@ -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):
Copy link
Member

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?

Copy link
Collaborator Author

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.

zas added a commit to zas/picard that referenced this pull request Jun 25, 2015
zas added 5 commits June 25, 2015 11:48
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
@zas
Copy link
Collaborator Author

zas commented Jun 26, 2015

capture du 2015-06-26 15 40 54
capture du 2015-06-26 15 40 41
capture du 2015-06-26 15 40 07
@phw : can you test with your plugin ? i didnt try

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"))

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)?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in 2f3816e

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@zas
Copy link
Collaborator Author

zas commented Jul 1, 2015

PR splitted in two separated PRs:
#411
#412

@zas zas closed this Jul 1, 2015
@zas zas deleted the local_cover_art branch March 30, 2019 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants