From 2c78cee8e7854493001d8470d33fc57ce1259906 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 13 Feb 2010 15:25:07 -0700 Subject: [PATCH] Fix #4888 (Exact match search doesn't work when book has multiple formats) --- src/calibre/library/database2.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/library/database2.py b/src/calibre/library/database2.py index d1a0c24cef..477d0846e0 100644 --- a/src/calibre/library/database2.py +++ b/src/calibre/library/database2.py @@ -241,6 +241,7 @@ class ResultCache(SearchQueryParser): for x in all: MAP[x] = FIELD_MAP[x] EXCLUDE_FIELDS = [MAP['rating'], MAP['cover']] + SPLITABLE_FIELDS = [MAP['authors'], MAP['tags'], MAP['formats']] location = [location] if location != 'all' else list(MAP.keys()) for i, loc in enumerate(location): location[i] = MAP[loc] @@ -275,8 +276,8 @@ class ResultCache(SearchQueryParser): matches.add(item[0]) continue if loc not in EXCLUDE_FIELDS: - if loc == MAP['tags'] or loc == MAP['authors']: - vals = item[loc].split(',') ### check individual tags/authors, not the long string + if loc in SPLITABLE_FIELDS: + vals = item[loc].split(',') ### check individual tags/authors/formats, not the long string else: vals = [item[loc]] ### make into list to make _match happy if _match(q, vals, matchkind):