geigerzaehler / beets-alternatives

Beets plugin to manage external files
MIT License
94 stars 22 forks source link

Respect convert's threads configuration #71

Closed johnyerhot closed 1 year ago

johnyerhot commented 1 year ago

Small PR that adds support for respecting convert's threads config. https://github.com/geigerzaehler/beets-alternatives/issues/41.

I didn't write any tests so that's now awesome but Works on My Machine™.

The code located here is probably also not needed or could be refactored to remove setting threads to CPU count since that should already be done via the convert plugin.

geigerzaehler commented 1 year ago

Thanks for the contribution @johnyerhot! Before this gets merged could you also construct the Worker with the right number of threads in the this location? Could you also make sure your code is properly formatted by running poetry run black .?

The code located here is probably also not needed or could be refactored to remove setting threads to CPU count since that should already be done via the convert plugin.

You’re right. Would you care to fix this, too?

johnyerhot commented 1 year ago

Before this gets merged could you also construct the Worker with the right number of threads in the this location?

Doh! Yep, did it!

Could you also make sure your code is properly formatted by running poetry run black .?

Done and done.

You’re right. Would you care to fix this, too?

Done and done. I believe we can completely remove all references to it and assume there will be a value in max_workers since we're directly sucking in the value from its threads config. The will always be a value or cpu threads.

All behaved as expected in my testing. Thanks for the help @geigerzaehler ❤️

geigerzaehler commented 1 year ago

Thanks for the follow-up! The PR is missing one final formatting touch: poetry run isort .. Once you’ve fixed this I’ll merge it and release a new version.

johnyerhot commented 1 year ago

Done and done @geigerzaehler!

geigerzaehler commented 1 year ago

Released in v0.11.0