adamjakab / BeetsPluginAutofix

A beets plugin for obsessive-compulsive music geeks to run repetitive tasks all in one go.
MIT License
9 stars 2 forks source link

Setting threads=0 causes error #4

Closed adamjakab closed 4 years ago

adamjakab commented 4 years ago

Threads is currently set to 1 by default. It is possible to increment the number but not possible (as the guide says) to have it automatically calculated by the plugin to set it to the number of cores. If it is set to 0 (zero) the plugin will exit with:

Traceback (most recent call last):
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1266, in main
    _raw_main(args)
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/ui/__init__.py", line 1253, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginXtractor/beetsplug/xtractor/command.py", line 130, in func
    self.xtract()
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginXtractor/beetsplug/xtractor/command.py", line 146, in xtract
    self._execute_on_each_items(self.items_to_analyse, self.run_full_analysis)
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginXtractor/beetsplug/xtractor/command.py", line 292, in _execute_on_each_items
    with futures.ThreadPoolExecutor(max_workers=self.cfg_threads) as e:
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/concurrent/futures/thread.py", line 129, in __init__
    raise ValueError("max_workers must be greater than 0")
ValueError: max_workers must be greater than 0
adamjakab commented 4 years ago

This bug report was intended for another repo.