mirror of
https://github.com/beetbox/beets.git
synced 2025-12-28 11:32:30 +01:00
Merge pull request #2742 from broddo/hook/bug
Addresses hook.py ability to handle non-string item properties
This commit is contained in:
commit
9ee643f54c
2 changed files with 6 additions and 4 deletions
|
|
@ -64,10 +64,8 @@ class CodingFormatter(string.Formatter):
|
|||
converted = super(CodingFormatter, self).convert_field(value,
|
||||
conversion)
|
||||
|
||||
try:
|
||||
converted = converted.decode(self._coding)
|
||||
except UnicodeEncodeError:
|
||||
pass
|
||||
if isinstance(converted, bytes):
|
||||
return converted.decode(self._coding)
|
||||
|
||||
return converted
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@ New features:
|
|||
|
||||
Fixes:
|
||||
|
||||
* :doc:`/plugins/hook`: Fixed a problem whereby accessing non-string properties of
|
||||
objects such as item or album (e.g. item.track) would cause a crash.
|
||||
Thanks to :user:`broddo`.
|
||||
:bug:`2740`
|
||||
* :doc:`/plugins/play`: When ``relative_to`` is set, correctly emit relative paths
|
||||
even when querying for albums rather than tracks.
|
||||
Thanks to :user:`j000`.
|
||||
|
|
|
|||
Loading…
Reference in a new issue