mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2025-06-17 05:36:12 +00:00
Fix datetime error
Known kodi/python issue where datetime.strptime throws a Nonetype error for no reason, after being used once.
This commit is contained in:
parent
afcb3461b4
commit
256d98c6f3
2 changed files with 15 additions and 4 deletions
|
@ -6,6 +6,7 @@ import cProfile
|
|||
import inspect
|
||||
import pstats
|
||||
import sqlite3
|
||||
from datetime import datetime, time
|
||||
import time
|
||||
import unicodedata
|
||||
import xml.etree.ElementTree as etree
|
||||
|
@ -238,6 +239,16 @@ def stopProfiling(pr, profileName):
|
|||
"{0}".format(cumulative_time), func_name, filename))
|
||||
f.close()
|
||||
|
||||
def convertdate(date):
|
||||
try:
|
||||
date = datetime.strptime(date, "%Y-%m-%dT%H:%M:%SZ")
|
||||
except TypeError:
|
||||
# TypeError: attribute of type 'NoneType' is not callable
|
||||
# Known Kodi/python error
|
||||
date = datetime(*(time.strptime(date, "%Y-%m-%dT%H:%M:%SZ")[0:6]))
|
||||
|
||||
return date
|
||||
|
||||
def normalize_nodes(text):
|
||||
# For video nodes
|
||||
text = text.replace(":", "")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue