mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 22:43:34 -07:00
fix: handle recipe-scraper returning a int when it parses a time itself
This commit is contained in:
parent
104c9b36a5
commit
cf1768677b
1 changed files with 4 additions and 0 deletions
|
@ -2,6 +2,7 @@ import contextlib
|
||||||
import functools
|
import functools
|
||||||
import html
|
import html
|
||||||
import json
|
import json
|
||||||
|
import numbers
|
||||||
import operator
|
import operator
|
||||||
import re
|
import re
|
||||||
import typing
|
import typing
|
||||||
|
@ -412,6 +413,9 @@ def clean_time(time_entry: str | timedelta | None, translator: Translator) -> No
|
||||||
return None
|
return None
|
||||||
|
|
||||||
match time_entry:
|
match time_entry:
|
||||||
|
case numbers.Number:
|
||||||
|
time_delta = timedelta(minutes=time_entry)
|
||||||
|
return pretty_print_timedelta(time_delta, translator)
|
||||||
case str(time_entry):
|
case str(time_entry):
|
||||||
if not time_entry.strip():
|
if not time_entry.strip():
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue