From db223496d66d602c1b3cda1f1638df1174b9566a Mon Sep 17 00:00:00 2001 From: Dave Hayes Date: Mon, 28 Jan 2013 14:26:24 -0600 Subject: [PATCH] Safely cast ASFBoolAttributes * Modify _safe_cast to account for ASFBoolAttributes --- beets/mediafile.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/beets/mediafile.py b/beets/mediafile.py index ef2d53c58..e32626e27 100644 --- a/beets/mediafile.py +++ b/beets/mediafile.py @@ -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