mirror of
https://github.com/cupcakearmy/mercatus.git
synced 2024-12-22 08:06:28 +00:00
check if stock is enabled in the auto update
This commit is contained in:
parent
03d2ed7aa3
commit
3a6f90ffec
@ -62,9 +62,10 @@ def send_update_to_user(user: str, auto, codes=None):
|
|||||||
last_run = code_data[Section.LastRun.value]
|
last_run = code_data[Section.LastRun.value]
|
||||||
frequency = parse(code_data[Section.Frequency.value])
|
frequency = parse(code_data[Section.Frequency.value])
|
||||||
interval = parse(code_data[Section.Interval.value])
|
interval = parse(code_data[Section.Interval.value])
|
||||||
|
enabled = code_data[Section.Enabled.value]
|
||||||
# print(code, last_run + frequency, now, last_run + frequency - now)
|
# print(code, last_run + frequency, now, last_run + frequency - now)
|
||||||
|
|
||||||
if auto and last_run + frequency > now:
|
if auto and (last_run + frequency > now or not enabled):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
code_data[Section.LastRun.value] = current_timestamp()
|
code_data[Section.LastRun.value] = current_timestamp()
|
||||||
|
@ -132,7 +132,6 @@ def single(update, context):
|
|||||||
elif selected == BACK:
|
elif selected == BACK:
|
||||||
return show_menu(update, context)
|
return show_menu(update, context)
|
||||||
elif selected == ENABLED:
|
elif selected == ENABLED:
|
||||||
print('Changing', wl[Section.Enabled.value])
|
|
||||||
wl[current][Section.Enabled.value] = not wl[current][Section.Enabled.value]
|
wl[current][Section.Enabled.value] = not wl[current][Section.Enabled.value]
|
||||||
save_watchlist(context, wl)
|
save_watchlist(context, wl)
|
||||||
return show_single(update, context)
|
return show_single(update, context)
|
||||||
|
Loading…
Reference in New Issue
Block a user