%if{} template function should work with Python booleans
Currently, if the first argument to an %if{} is the string "False", it treats the condition as true. It should special-case this string to facilitate use with inline functions that return booleans.

diff --git a/beets/library.py b/beets/library.py
index 95dffee70..bb10f7392 100644
--- a/beets/library.py
+++ b/beets/library.py
@@ -1121,9 +1121,13 @@ class DefaultTemplateFunctions(object):
         otherwise, emit ``falseval`` (if provided).
         """
         try:
-            condition = _int_arg(condition)
+            int_condition = _int_arg(condition)
         except ValueError:
-            condition = condition.strip()
+            if condition.lower() == "false":
+                return falseval
+        else:
+            condition = int_condition
+
         if condition:
             return trueval
         else:
diff --git a/test/test_library.py b/test/test_library.py
index a39e5ce30..eea513454 100644
--- a/test/test_library.py
+++ b/test/test_library.py
@@ -496,6 +496,10 @@ class DestinationFunctionTest(_common.TestCase, PathFormattingMixin):
         self._setf(u'x%if{,foo}')
         self._assert_dest('/base/x')
 
+    def test_if_false_value(self):
+        self._setf(u'x%if{false,foo}')
+        self._assert_dest('/base/x')
+
     def test_if_true(self):
         self._setf(u'%if{bar,foo}')
         self._assert_dest('/base/foo')
@@ -504,6 +508,10 @@ class DestinationFunctionTest(_common.TestCase, PathFormattingMixin):
         self._setf(u'%if{,foo,baz}')
         self._assert_dest('/base/baz')
 
+    def test_if_else_false_value(self):
+        self._setf(u'%if{false,foo,baz}')
+        self._assert_dest('/base/baz')
+
     def test_if_int_value(self):
         self._setf(u'%if{0,foo,baz}')
         self._assert_dest('/base/baz')
['test/test_library.py', 'beets/library.py']