Formatierung von "Kodiitem" (äüö etc.) angepasst
This commit is contained in:
parent
84123dddac
commit
48dfc09a3f
1 changed files with 24 additions and 4 deletions
|
|
@ -40,12 +40,32 @@ class kodi():
|
|||
a = self.kodi_JSON_holen()
|
||||
if a != None:
|
||||
for i in koditems:
|
||||
wert = self.kodi_suche_nach(i,a)
|
||||
koditems[i] = wert
|
||||
string = self.kodi_suche_nach(i,a)
|
||||
if type(string)==str:
|
||||
string = string.replace("ä", "ae").replace("Ä", "Ae").replace("ö", "oe").replace("Ö", "oe").replace(
|
||||
"ü", "ue").replace("Ü", "Ue").replace(" ", "_")
|
||||
elif string == None:
|
||||
string =""
|
||||
koditems[i] = string
|
||||
if koditems["type"] == "episode":
|
||||
if len(koditems["season"]) == 1:
|
||||
koditems["season"] = "S0" + koditems["season"]
|
||||
else:
|
||||
koditems["season"] = "S" + koditems["season"]
|
||||
if len(koditems["episode"]) == 1:
|
||||
koditems["episode"] = "E0" + koditems["episode"]
|
||||
else:
|
||||
koditems["episode"] = "E" + koditems["episode"]
|
||||
elif koditems["type"] == "movie":
|
||||
koditems["season"] = ""
|
||||
koditems["episode"] = ""
|
||||
elif koditems["type"] == "unknown":
|
||||
koditems["season"] = ""
|
||||
koditems["episode"] = ""
|
||||
|
||||
return koditems
|
||||
|
||||
#url= "http://10.0.1.102/jsonrpc?request=%7B%22jsonrpc%22:%20%222.0%22,%20%22method%22:%20%22Player.GetItem%22,%20%22params%22:%20%7B%20%22properties%22:%20%5B%22title%22,%20%22album%22,%20%22artist%22,%20%22season%22,%20%22episode%22,%20%22duration%22,%20%22showtitle%22,%20%22tvshowid%22,%20%22thumbnail%22,%20%22file%22,%20%22fanart%22,%20%22streamdetails%22%5D,%20%22playerid%22:%201%20%7D,%20%22id%22:%20%22VideoGetItem%22%7D"
|
||||
a = kodi("10.0.1.102")
|
||||
print(a.kodi_JSON_holen())
|
||||
print(a.kodi_suche_nach("fanart"))
|
||||
print(a.kodi_suche_nach("type"))
|
||||
print(a.kodiitem())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue