From 9587caf916974b6280625f5fe70a6c122d65440a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Haa=C3=9F?= Date: Tue, 19 Jan 2021 18:47:02 +0100 Subject: [PATCH] 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 --- beetsplug/convert.py | 5 +++-- docs/changelog.rst | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/beetsplug/convert.py b/beetsplug/convert.py index 70363f6eb..275703e97 100644 --- a/beetsplug/convert.py +++ b/beetsplug/convert.py @@ -16,6 +16,7 @@ """Converts tracks or albums to external directory """ from __future__ import division, absolute_import, print_function +from beets.util import par_map import os import threading @@ -183,8 +184,8 @@ class ConvertPlugin(BeetsPlugin): def auto_convert(self, config, task): if self.config['auto']: - for item in task.imported_items(): - self.convert_on_import(config.lib, item) + par_map(lambda item: self.convert_on_import(config.lib, item), + task.imported_items()) # Utilities converted from functions to methods on logging overhaul diff --git a/docs/changelog.rst b/docs/changelog.rst index 0fb503f80..4f5fdbddc 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -6,6 +6,7 @@ Changelog New features: +* conversion uses par_map to parallelize conversion jobs in python3 * Add ``title_case`` config option to lastgenre to make TitleCasing optional. * When config is printed with no available configuration a new message is printed. :bug:`3779`