From e81d9f9fb2cfd3dea0ed8fc1bd59f4a463b3454e Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Thu, 3 Mar 2011 18:30:03 +0000 Subject: [PATCH 1/2] Make identifiers category go away. --- src/calibre/library/server/opds.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/library/server/opds.py b/src/calibre/library/server/opds.py index 72a802eaa9..0e7ed91388 100644 --- a/src/calibre/library/server/opds.py +++ b/src/calibre/library/server/opds.py @@ -580,7 +580,7 @@ class OPDSServer(object): for category in sorted(categories, key=lambda x: sort_key(getter(x))): if len(categories[category]) == 0: continue - if category == 'formats': + if category == 'formats' or category == 'identifiers': continue meta = category_meta.get(category, None) if meta is None: From 22081986c7d41096f7b76e4fdd1b8e3a8a74d6f1 Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Fri, 4 Mar 2011 12:15:30 +0000 Subject: [PATCH 2/2] Replace parse_date with an field-extraction parser for date conversion in sqlite.py --- src/calibre/library/sqlite.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/calibre/library/sqlite.py b/src/calibre/library/sqlite.py index 1b595435ce..f65a640146 100644 --- a/src/calibre/library/sqlite.py +++ b/src/calibre/library/sqlite.py @@ -23,10 +23,24 @@ from calibre.constants import iswindows, DEBUG from calibre.utils.icu import strcmp from calibre import prints +from dateutil.tz import tzoffset + global_lock = RLock() def convert_timestamp(val): if val: + try: + year = int(val[0:4]) + month = int(val[5:7]) + day = int(val[8:10]) + hour = int(val[11:13]) + min = int(val[14:16]) + sec = int(val[17:19]) + sign = val[19] + tzmins = (int(val[-5:-3])*60 + int(val[-2:])) * (1 if sign == '+' else -1) + return datetime(year, month, day, hour, min, sec, tzinfo=tzoffset(None, tzmins)) + except: + pass return parse_date(val, as_utc=False) return None