From d65f2b8095eb65d5b2ce0c39bbe191baf8bfde49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Inge=20Lea=20Bj=C3=B8rnsen?= Date: Wed, 19 Feb 2014 20:50:13 +0100 Subject: [PATCH] Query date intervals by their numeric epoch time. SQLite store dates as epoch time offsets in UTC. By converting date interval endpoints to UTC epoch time in Python, using the SQLite date functions isn't necessary any more. --- beets/dbcore/query.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/beets/dbcore/query.py b/beets/dbcore/query.py index 4fefb6637..be4172692 100644 --- a/beets/dbcore/query.py +++ b/beets/dbcore/query.py @@ -461,7 +461,7 @@ class DateQuery(FieldQuery): date = datetime.utcfromtimestamp(timestamp) return self.interval.contains(date) - _clause_tmpl = "datetime({0}, 'unixepoch') {1} datetime(?, 'unixepoch')" + _clause_tmpl = "{0} {1} ?" def col_clause(self): clause_parts = []