mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
5b84dcb722
commit
a96d7ac336
@ -14,7 +14,7 @@ from lxml import etree
|
|||||||
from lxml.builder import ElementMaker
|
from lxml.builder import ElementMaker
|
||||||
|
|
||||||
from calibre import force_unicode
|
from calibre import force_unicode
|
||||||
from calibre.utils.date import parse_date, now as nowf, utcnow, tzlocal, \
|
from calibre.utils.date import parse_date, now as nowf, utcnow, local_tz, \
|
||||||
isoformat, fromordinal
|
isoformat, fromordinal
|
||||||
from calibre.utils.recycle_bin import delete_file
|
from calibre.utils.recycle_bin import delete_file
|
||||||
|
|
||||||
@ -420,14 +420,14 @@ class SchedulerConfig(object):
|
|||||||
return utcnow() - ld > timedelta(sch)
|
return utcnow() - ld > timedelta(sch)
|
||||||
elif typ == 'day/time':
|
elif typ == 'day/time':
|
||||||
now = nowf()
|
now = nowf()
|
||||||
ld_local = ld.astimezone(tzlocal())
|
ld_local = ld.astimezone(local_tz)
|
||||||
day, hour, minute = sch
|
day, hour, minute = sch
|
||||||
return is_weekday(day, now) and \
|
return is_weekday(day, now) and \
|
||||||
not was_downloaded_already_today(ld_local, now) and \
|
not was_downloaded_already_today(ld_local, now) and \
|
||||||
is_time(now, hour, minute)
|
is_time(now, hour, minute)
|
||||||
elif typ == 'days_of_week':
|
elif typ == 'days_of_week':
|
||||||
now = nowf()
|
now = nowf()
|
||||||
ld_local = ld.astimezone(tzlocal())
|
ld_local = ld.astimezone(local_tz)
|
||||||
days, hour, minute = sch
|
days, hour, minute = sch
|
||||||
have_day = False
|
have_day = False
|
||||||
for day in days:
|
for day in days:
|
||||||
@ -439,7 +439,7 @@ class SchedulerConfig(object):
|
|||||||
is_time(now, hour, minute)
|
is_time(now, hour, minute)
|
||||||
elif typ == 'days_of_month':
|
elif typ == 'days_of_month':
|
||||||
now = nowf()
|
now = nowf()
|
||||||
ld_local = ld.astimezone(tzlocal())
|
ld_local = ld.astimezone(local_tz)
|
||||||
days, hour, minute = sch
|
days, hour, minute = sch
|
||||||
have_day = now.day in days
|
have_day = now.day in days
|
||||||
return have_day and \
|
return have_day and \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user