convert: uses new par_map to work in parallel (#3830)

Squashed 5 commits:
* convert: uses new par_map to work in parallel
* linting
* code review: remove unneeded list syntax
* linting
* changelog addition
This commit is contained in:
Martin Haaß 2021-01-19 18:47:02 +01:00 committed by GitHub
parent cbc045f1c8
commit 9587caf916
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -16,6 +16,7 @@
"""Converts tracks or albums to external directory """Converts tracks or albums to external directory
""" """
from __future__ import division, absolute_import, print_function from __future__ import division, absolute_import, print_function
from beets.util import par_map
import os import os
import threading import threading
@ -183,8 +184,8 @@ class ConvertPlugin(BeetsPlugin):
def auto_convert(self, config, task): def auto_convert(self, config, task):
if self.config['auto']: if self.config['auto']:
for item in task.imported_items(): par_map(lambda item: self.convert_on_import(config.lib, item),
self.convert_on_import(config.lib, item) task.imported_items())
# Utilities converted from functions to methods on logging overhaul # Utilities converted from functions to methods on logging overhaul

View file

@ -6,6 +6,7 @@ Changelog
New features: New features:
* conversion uses par_map to parallelize conversion jobs in python3
* Add ``title_case`` config option to lastgenre to make TitleCasing optional. * Add ``title_case`` config option to lastgenre to make TitleCasing optional.
* When config is printed with no available configuration a new message is printed. * When config is printed with no available configuration a new message is printed.
:bug:`3779` :bug:`3779`