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

Issue with certain characters #7

Closed Sohex closed 1 month ago

Sohex commented 2 years ago

Problem

Running your command in verbose (-vv) mode:

$ beet -vv autofix (... paste here the rest...)
user configuration: config.yaml
data directory: beets
plugin paths: 
/usr/local/lib/python3.8/dist-packages/beets/util/confit.py:19: UserWarning: beets.util.confit is deprecated; use confuse instead
  warnings.warn("beets.util.confit is deprecated; use confuse instead")
lyrics: Disabling google source: no API key configured.
Sending event: pluginload
library database: .config/beets/library.db
library directory: music
Sending event: library_opened
autofix: Task(year_fixer) is not enabled! Skipping.
autofix: Task(ab_data_fetcher) is not enabled! Skipping.
autofix: Task(audio_conversion) is not enabled! Skipping.
autofix: Task(tag_cleaner) is not enabled! Skipping.
autofix: Task(xtractor) is not enabled! Skipping.
autofix: Task(genre_finder) is not enabled! Skipping.
autofix: The following tasks will be executed: missing_file_checker
autofix: Selection query[[]]: AndQuery([TrueQuery()])
autofix: Ordering[[]]: <FixedFieldSort: albumartist+>
autofix: Total number of items: 30752
|⚠︎                                       | (!) 0/30752 [0%] in 0.4s (0.00/s)
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/dist-packages/beets/ui/__init__.py", line 1285, in main
    _raw_main(args)
  File "/usr/local/lib/python3.8/dist-packages/beets/ui/__init__.py", line 1272, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/cfutro/.local/lib/python3.8/site-packages/beetsplug/autofix/command.py", line 75, in func
    self._execute_tasks_for_all_items()
  File "/home/cfutro/.local/lib/python3.8/site-packages/beetsplug/autofix/command.py", line 85, in _execute_tasks_for_all_items
    bar(str(item))
  File "/home/cfutro/.local/lib/python3.8/site-packages/alive_progress/core/progress.py", line 342, in __call__
    self._handle(*args, **kwargs)
  File "/home/cfutro/.local/lib/python3.8/site-packages/alive_progress/core/progress.py", line 151, in bar_handle
    run.count += max(1, int(count))
ValueError: invalid literal for int() with base 10: '!!! - Me and Giuliani Down by the School Yard (A True Story) - Me and Giuliani Down by the School Yard (A True Story)'

Led to this problem:

ValueError: invalid literal for int() with base 10: '!!! - Me and Giuliani Down by the School Yard (A True Story) - Me and Giuliani Down by the School Yard (A True Story)'

I'm guessing the issue is with the '!!!' at the start of the name there.

Setup

My configuration (output of beet config) is:

autofix:
  tasks:
    missing_file_checker:
      enabled: no

My plugin version (output of beet autofix -v) is:

autofix: Autofix(beets-autofix) plugin for Beets: v0.1.2
adamjakab commented 1 month ago

fixed in #9