mirror of
https://github.com/NohamR/OqeeRewind.git
synced 2026-04-08 02:50:01 +00:00
Validate end_date is not in the future
This commit is contained in:
7
main.py
7
main.py
@@ -344,6 +344,9 @@ if __name__ == "__main__":
|
||||
if not end_date:
|
||||
logger.error("Either end-date or duration is required in CLI mode")
|
||||
sys.exit(1)
|
||||
if end_date > datetime.now():
|
||||
logger.error("End date cannot be in the future :p")
|
||||
sys.exit(1)
|
||||
|
||||
keys = args.key or []
|
||||
# END_SUFFIX = ".".join([args.video, args.audio]) if args.video and args.audio else ""
|
||||
@@ -396,6 +399,10 @@ if __name__ == "__main__":
|
||||
end_date = program_selection["end_date"]
|
||||
title = program_selection["title"]
|
||||
|
||||
if end_date > datetime.now():
|
||||
logger.error("End date cannot be in the future :p")
|
||||
sys.exit(1)
|
||||
|
||||
title = title or f"{freebox_id}_{start_date.strftime('%Y%m%d_%H%M%S')}"
|
||||
keys = []
|
||||
|
||||
|
||||
Reference in New Issue
Block a user