Support listmodified before and after argument
This commit is contained in:
parent
6fc66b7b13
commit
00c9c14efb
1 changed files with 7 additions and 5 deletions
|
@ -126,11 +126,13 @@ class ContentDb(Db):
|
||||||
|
|
||||||
return row["size"], row["size_optional"]
|
return row["size"], row["size_optional"]
|
||||||
|
|
||||||
def listModified(self, site, since):
|
def listModified(self, site, after=None, before=None):
|
||||||
res = self.execute(
|
params = {"site_id": self.site_ids.get(site.address, 0)}
|
||||||
"SELECT inner_path, modified FROM content WHERE site_id = :site_id AND modified > :since",
|
if after:
|
||||||
{"site_id": self.site_ids.get(site.address, 0), "since": since}
|
params["modified>"] = after
|
||||||
)
|
if before:
|
||||||
|
params["modified<"] = before
|
||||||
|
res = self.execute("SELECT inner_path, modified FROM content WHERE ?", params)
|
||||||
return {row["inner_path"]: row["modified"] for row in res}
|
return {row["inner_path"]: row["modified"] for row in res}
|
||||||
|
|
||||||
content_dbs = {}
|
content_dbs = {}
|
||||||
|
|
Loading…
Reference in a new issue