mirror of
https://github.com/morpheus65535/bazarr
synced 2025-01-03 05:25:28 +00:00
Bug correction
This commit is contained in:
parent
09cb87feeb
commit
3c216ad8a1
1 changed files with 19 additions and 15 deletions
34
bazarr.py
34
bazarr.py
|
@ -307,32 +307,36 @@ def system():
|
|||
interval_clean = interval_clean[1][:-1]
|
||||
interval_split = interval_clean.split(':')
|
||||
|
||||
hour = interval_split[0]
|
||||
minute = interval_split[1].lstrip("0")
|
||||
second = interval_split[2].lstrip("0")
|
||||
|
||||
text = "every "
|
||||
if interval_split[0] != "0":
|
||||
text = text + interval_split[0]
|
||||
if interval_split[0] == "1":
|
||||
if hour != "0":
|
||||
text = text + hour
|
||||
if hour == "1":
|
||||
text = text + " hour"
|
||||
else:
|
||||
text = text + " hours"
|
||||
|
||||
if interval_split[2] == "00":
|
||||
text = text + " and "
|
||||
elif interval_split[1] != "00":
|
||||
if minute != "" and second != "":
|
||||
text = text + ", "
|
||||
if interval_split[1] != "00":
|
||||
text = text + interval_split[1].lstrip("0")
|
||||
if interval_split[1].lstrip("0") == "1":
|
||||
elif minute == "" and second != "":
|
||||
text = text + " and "
|
||||
elif minute != "" and second == "":
|
||||
text = text + " and "
|
||||
if minute != "":
|
||||
text = text + minute
|
||||
if minute == "1":
|
||||
text = text + " minute"
|
||||
else:
|
||||
text = text + " minutes"
|
||||
|
||||
if interval_split[2] != "00":
|
||||
if second != "":
|
||||
text = text + " and "
|
||||
if interval_split[1] == "00":
|
||||
text = text + " and "
|
||||
if interval_split[2] != "00":
|
||||
text = text + interval_split[2].lstrip("0")
|
||||
if interval_split[2].lstrip("0") == "1":
|
||||
if second != "":
|
||||
text = text + second
|
||||
if second == "1":
|
||||
text = text + " second"
|
||||
else:
|
||||
text = text + " seconds"
|
||||
|
|
Loading…
Reference in a new issue