From 7e01a27124f236f8625dfc19085101f16d53dd0b Mon Sep 17 00:00:00 2001 From: Ayberk Yilmaz Date: Sat, 19 Apr 2014 00:07:17 +0300 Subject: [PATCH] Minor adjustments based on feedback --- beets/library.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/beets/library.py b/beets/library.py index f46790020..f7cb88365 100644 --- a/beets/library.py +++ b/beets/library.py @@ -25,7 +25,7 @@ from unidecode import unidecode from beets.mediafile import MediaFile, MutagenError from beets import plugins from beets import util -from beets.util import bytestring_path, syspath, normpath, samefile +from beets.util import bytestring_path, syspath, normpath, samefile, str2bool from beets.util.functemplate import Template from beets import dbcore from beets.dbcore import types @@ -1121,11 +1121,13 @@ class DefaultTemplateFunctions(object): otherwise, emit ``falseval`` (if provided). """ try: - condition = _int_arg(condition) + int_condition = _int_arg(condition) except ValueError: if condition.lower() == "false": return falseval - condition = condition.strip() + else: + condition = int_condition + if condition: return trueval else: