adamjakab / BeetsPluginXtractor

A beets plugin for obsessive-compulsive music geeks to add low and high level musical information to their songs.
MIT License
37 stars 4 forks source link

No check on items_per_run config option #6

Closed adamjakab closed 2 years ago

adamjakab commented 4 years ago

Problem

when running the plugin with configuration items_per_run: 1 and the number of items found in the library are less than or equal to that number, the plugin exits with the following backtrace:

xtractor: Combined query: AndQuery([TrueQuery()])
xtractor: Number of items to be processed: 1
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 129, in func
    self.xtract()
  File "/Users/jackisback/Documents/Projects/Python/BeetsPluginXtractor/beetsplug/xtractor/command.py", line 141, in xtract
    self.items_to_analyse = self.items_to_analyse[:self.cfg_items_per_run]
  File "/Users/jackisback/opt/miniconda3/envs/beetsdevel/lib/python3.7/site-packages/beets/dbcore/db.py", line 770, in __getitem__
    for i in range(n):
TypeError: 'slice' object cannot be interpreted as an integer
adamjakab commented 2 years ago

This appears to have been solved a long time ago