Skip to content

Commit 9587caf

Browse files
authored
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
1 parent cbc045f commit 9587caf

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

beetsplug/convert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"""Converts tracks or albums to external directory
1717
"""
1818
from __future__ import division, absolute_import, print_function
19+
from beets.util import par_map
1920

2021
import os
2122
import threading
@@ -183,8 +184,8 @@ def commands(self):
183184

184185
def auto_convert(self, config, task):
185186
if self.config['auto']:
186-
for item in task.imported_items():
187-
self.convert_on_import(config.lib, item)
187+
par_map(lambda item: self.convert_on_import(config.lib, item),
188+
task.imported_items())
188189

189190
# Utilities converted from functions to methods on logging overhaul
190191

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Changelog
66

77
New features:
88

9+
* conversion uses par_map to parallelize conversion jobs in python3
910
* Add ``title_case`` config option to lastgenre to make TitleCasing optional.
1011
* When config is printed with no available configuration a new message is printed.
1112
:bug:`3779`

0 commit comments

Comments
 (0)