2020-09-12, 23:43
Hello, I believe I've found a bug, but wondering if this is expected or not, or if there's a workaround.
I pass dates to Kodi listitems via a dictionary:
The docs state the format needs to be:
date string (d.m.Y / 01.01.2009) - file date
So I have a function that parses an unformatted date I get from outside sources:
The problem is, when I recieve garbage from my outside source, (for example date_in = 'blah'), then when I pass None to setinfo date the logs are spammed with:
Is there a value I can pass to setinfo that will both be valid and be "None"? Since I can't control the data I receive, I need to have a fallback value to be able to pass.
Thanks in advance for any suggestions.
I pass dates to Kodi listitems via a dictionary:
python:
li.setInfo(media_type,{'date':parsed_date})
The docs state the format needs to be:
date string (d.m.Y / 01.01.2009) - file date
So I have a function that parses an unformatted date I get from outside sources:
python:
try:
return date_parser.parse(date_in).strftime('%d.%m.%Y')
except:
return None
The problem is, when I recieve garbage from my outside source, (for example date_in = 'blah'), then when I pass None to setinfo date the logs are spammed with:
python:
ERROR <general>: NEWADDON Invalid Date Format ""
Is there a value I can pass to setinfo that will both be valid and be "None"? Since I can't control the data I receive, I need to have a fallback value to be able to pass.
Thanks in advance for any suggestions.