[Python-apps-commits] r9822 - in packages/beets/trunk/debian/patches (fix-bpd-search)

laarmen-guest at users.alioth.debian.org laarmen-guest at users.alioth.debian.org
Tue Jul 2 09:13:34 UTC 2013


    Date: Tuesday, July 2, 2013 @ 09:13:33
  Author: laarmen-guest
Revision: 9822

Actually add the patch

Added:
  packages/beets/trunk/debian/patches/fix-bpd-search

Added: packages/beets/trunk/debian/patches/fix-bpd-search
===================================================================
--- packages/beets/trunk/debian/patches/fix-bpd-search	                        (rev 0)
+++ packages/beets/trunk/debian/patches/fix-bpd-search	2013-07-02 09:13:33 UTC (rev 9822)
@@ -0,0 +1,40 @@
+From: Simon Chopin <chopin.simon at gmail.com>
+Date: Tue, 2 Jul 2013 11:00:10 +0200
+Description: bpd: Use AnyFieldQuery when searching "any" fields
+ BPD hadn't been ported when AnySubstringQuery was removed, resulting in
+ crash, death and horror when using the search function.
+Forwarded: https://github.com/sampsyo/beets/pull/340
+
+diff --git a/beetsplug/bpd/__init__.py b/beetsplug/bpd/__init__.py
+index bebcf1b..6d79405 100644
+--- a/beetsplug/bpd/__init__.py
++++ b/beetsplug/bpd/__init__.py
+@@ -31,6 +31,7 @@ import beets.ui
+ from beets import vfs
+ from beets import config
+ from beets.util import bluelet
++from beets.library import ITEM_KEYS_WRITABLE
+ 
+ PROTOCOL_VERSION = '0.13.0'
+ BUFSIZE = 1024
+@@ -997,7 +998,7 @@ class Server(BaseServer):
+             for tag, value in zip(it, it):
+                 if tag.lower() == u'any':
+                     if any_query_type:
+-                        queries.append(any_query_type(value))
++                        queries.append(any_query_type(value, ITEM_KEYS_WRITABLE, query_type))
+                     else:
+                         raise BPDError(ERROR_UNKNOWN, u'no such tagtype')
+                 else:
+@@ -1010,7 +1011,7 @@ class Server(BaseServer):
+     def cmd_search(self, conn, *kv):
+         """Perform a substring match for items."""
+         query = self._metadata_query(beets.library.SubstringQuery,
+-                                     beets.library.AnySubstringQuery,
++                                     beets.library.AnyFieldQuery,
+                                      kv)
+         for item in self.lib.items(query):
+             yield self._item_info(item)
+-- 
+1.8.3.1
+




More information about the Python-apps-commits mailing list