Commits

Anonymous committed f992563

Safely cast ASFBoolAttributes

* Modify _safe_cast to account for ASFBoolAttributes

  • Participants
  • Parent commits c55eaaf

Comments (0)

Files changed (1)

File beets/mediafile.py

             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