From bb9466e58e5298b23d65df6a620ad64b0b7d8f20 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 7 May 2013 09:23:58 +0530 Subject: [PATCH 1/2] Fix #1177114 (Cannot search for author name containing '"') --- src/calibre/utils/search_query_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/utils/search_query_parser.py b/src/calibre/utils/search_query_parser.py index 589aa313f2..9771f08133 100644 --- a/src/calibre/utils/search_query_parser.py +++ b/src/calibre/utils/search_query_parser.py @@ -135,7 +135,7 @@ class Parser(object): (r'[()]', lambda x,t: (1, t)), (r'@.+?:[^")\s]+', lambda x,t: (2, unicode(t))), (r'[^"()\s]+', lambda x,t: (2, unicode(t))), - (r'".*?((? Date: Tue, 7 May 2013 09:47:39 +0530 Subject: [PATCH 2/2] Fix #1177158 (Can not download an ORIGINAL_xxxx format book via the content server) --- src/calibre/library/server/content.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/calibre/library/server/content.py b/src/calibre/library/server/content.py index 86dae9efc7..45a46d6c56 100644 --- a/src/calibre/library/server/content.py +++ b/src/calibre/library/server/content.py @@ -61,7 +61,6 @@ class ContentServer(object): 8:'Aug', 9:'Sep', 10:'Oct', 11:'Nov', 12:'Dec'} return lm.replace('month', month[updated.month]) - def sort(self, items, field, order): field = self.db.data.sanitize_sort_field_name(field) if field not in self.db.field_metadata.sortable_field_keys(): @@ -77,7 +76,7 @@ class ContentServer(object): try: id = int(id) except ValueError: - id = id.rpartition('_')[-1].partition('.')[0] + id = id.rpartition('.')[0].rpartition('_')[-1] match = re.search(r'\d+', id) if not match: raise cherrypy.HTTPError(404, 'id:%s not an integer'%id)