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

Add setting "min_art_size" to prevent generating very small covers #68

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

jotak
Copy link

@jotak jotak commented Aug 7, 2022

For instance I see sometimes empty covers that are actually just a white
pixel. They shouldn't be considered as album covers.

For instance I see sometimes empty covers that are actually just a white
pixel. They shouldn't be considered as album covers.
@jotak
Copy link
Author

jotak commented Aug 7, 2022

PS: it's mostly to get my hands on the code, but I find that enhancement useful anyway

README.rst Outdated
@@ -181,6 +184,13 @@ Project resources
- `Changelog <https://github.com/mopidy/mopidy-local/releases>`_


Build locally and run
Copy link
Member

@kingosticks kingosticks Aug 8, 2022

Choose a reason for hiding this comment

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

We have development envinronment guidelines at https://docs.mopidy.com/en/latest/devenv/#working-on-extensions and this doesn't match that. We don't want to maintain instructions for each extension when they can just as well use the standard setup.

Copy link
Author

Choose a reason for hiding this comment

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

thanks! I was looking for such doc directly in the plugin's readme .. may I suggest to add a link from there?

Copy link
Member

Choose a reason for hiding this comment

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

Yes, it seems we can never have enough links back to the docs. We might as well add it to https://github.com/mopidy/cookiecutter-mopidy-ext at some point

Copy link
Author

Choose a reason for hiding this comment

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

by the way, this is an amazing doc that you have, this is rare enough to be reported! really, congrats
(and shame on me for not having seen it before)

mopidy_local/storage.py Outdated Show resolved Hide resolved
README.rst Outdated
@@ -181,6 +184,13 @@ Project resources
- `Changelog <https://github.com/mopidy/mopidy-local/releases>`_


Build locally and run
Copy link
Member

Choose a reason for hiding this comment

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

Yes, it seems we can never have enough links back to the docs. We might as well add it to https://github.com/mopidy/cookiecutter-mopidy-ext at some point

@@ -44,3 +44,6 @@ use_artist_sortname = false
# a list of file names to check for when searching for external album
# art; may contain UNIX shell patterns, i.e. "*", "?", etc.
album_art_files = *.jpg, *.jpeg, *.png

# minimum required size, in pixels, for an image to be picked up as an album cover
min_art_size = 32
Copy link
Member

Choose a reason for hiding this comment

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

Part of me think it's not totally obvious this means the width and height, and not the total pixel count. We should also say this new feature is disabled by setting the value to 0, or making it optional. And arguably 0 should be the default value else this is a breaking change.

And I think we should call it album_art_min_size to be more in line with the existing setting names.

Copy link
Author

Choose a reason for hiding this comment

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

maybe "dimension" would be less ambiguous than "size" ?

Copy link
Member

Choose a reason for hiding this comment

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

Perhaps just make the comment clearer. And it needs a corresponding entry in the configuration section of the readme

Copy link
Author

Choose a reason for hiding this comment

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

comment updated (and name also)
It's already documented in the readme too

btw, two tests added

Copy link
Member

@kingosticks kingosticks left a comment

Choose a reason for hiding this comment

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

I think the tests are broken

@jotak
Copy link
Author

jotak commented Aug 8, 2022

Thanks for the review @kingosticks

I think the tests are broken

Yes, it looks so 👀
I need to learn how to run python tests .. Now that you pointed me to the docs, it's will be easier :)

jotak and others added 2 commits August 8, 2022 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants