Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hook: Crash when trying to access {item.track} in command #2740

Closed
broddo opened this issue Nov 17, 2017 · 3 comments
Closed

hook: Crash when trying to access {item.track} in command #2740

broddo opened this issue Nov 17, 2017 · 3 comments
Labels
bug bugs that are confirmed and actionable

Comments

@broddo
Copy link
Contributor

broddo commented Nov 17, 2017

I'm playing around with hook in the hope to use it to keep a lossy version of my flac lib. I came across this issue when trying to generate a new path based on the imported item.

Here's the relevant part of the config:

hook:
    hooks:
        - event: write
          command: echo "writing track number {item.track}"

And the error:

File "/usr/local/lib/python2.7/site-packages/beetsplug/hook.py", line 68, in convert_field
    converted = converted.decode(self._coding)
AttributeError: 'int' object has no attribute 'decode'

This on Freebsd

@sampsyo
Copy link
Member

sampsyo commented Nov 17, 2017

Thank you! It looks like the plugin has a problem handing non-string fields. I’d guess that other numeric fields, like year or disc, would have the same problem.

@sampsyo sampsyo added the bug bugs that are confirmed and actionable label Nov 17, 2017
broddo pushed a commit to broddo/beets that referenced this issue Nov 20, 2017
broddo pushed a commit to broddo/beets that referenced this issue Nov 22, 2017
@jhermann
Copy link
Contributor

Solved, can be closed.

@sampsyo
Copy link
Member

sampsyo commented Mar 11, 2018

Indeed; thanks!

@sampsyo sampsyo closed this as completed Mar 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

No branches or pull requests

3 participants