mirror of
https://github.com/ankitects/anki.git
synced 2025-11-09 14:17:13 -05:00
fix v2 sched+hourly retention graph issue
This commit is contained in:
parent
dd01561537
commit
d51cdec73e
1 changed files with 6 additions and 2 deletions
|
|
@ -698,7 +698,11 @@ order by thetype, ease""" % lim)
|
||||||
lim = self._revlogLimit()
|
lim = self._revlogLimit()
|
||||||
if lim:
|
if lim:
|
||||||
lim = " and " + lim
|
lim = " and " + lim
|
||||||
sd = datetime.datetime.fromtimestamp(self.col.crt)
|
if self.col.schedVer() == 1:
|
||||||
|
sd = datetime.datetime.fromtimestamp(self.col.crt)
|
||||||
|
rolloverHour = sd.hour
|
||||||
|
else:
|
||||||
|
rolloverHour = self.col.conf["rollover"]
|
||||||
pd = self._periodDays()
|
pd = self._periodDays()
|
||||||
if pd:
|
if pd:
|
||||||
lim += " and id > %d" % ((self.col.sched.dayCutoff-(86400*pd))*1000)
|
lim += " and id > %d" % ((self.col.sched.dayCutoff-(86400*pd))*1000)
|
||||||
|
|
@ -710,7 +714,7 @@ cast(count() as float) * 100,
|
||||||
count()
|
count()
|
||||||
from revlog where type in (0,1,2) %s
|
from revlog where type in (0,1,2) %s
|
||||||
group by hour having count() > 30 order by hour""" % lim,
|
group by hour having count() > 30 order by hour""" % lim,
|
||||||
cut=self.col.sched.dayCutoff-(sd.hour*3600))
|
cut=self.col.sched.dayCutoff-(rolloverHour*3600))
|
||||||
|
|
||||||
# Cards
|
# Cards
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue