mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 01:25:47 +01:00
Safely cast ASFBoolAttributes
* Modify _safe_cast to account for ASFBoolAttributes
This commit is contained in:
parent
2f06a508bd
commit
db223496d6
1 changed files with 5 additions and 2 deletions
|
|
@ -108,8 +108,11 @@ def _safe_cast(out_type, val):
|
|||
return False
|
||||
else:
|
||||
try:
|
||||
# Should work for strings, bools, ints:
|
||||
return bool(int(val))
|
||||
if isinstance(val, mutagen.asf.ASFBoolAttribute):
|
||||
return bool(val)
|
||||
else:
|
||||
# Should work for strings, bools, ints:
|
||||
return bool(int(val))
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue