Remove redundant popinfo debug messages from mojedb function to streamline logging and improve code clarity.
This commit is contained in:
23
galdPl.py
23
galdPl.py
@@ -661,7 +661,6 @@ def db(params):
|
|||||||
|
|
||||||
def mojedb(params):
|
def mojedb(params):
|
||||||
xbmc.log("Debug: mojedb funkce spuštěna", xbmc.LOGDEBUG)
|
xbmc.log("Debug: mojedb funkce spuštěna", xbmc.LOGDEBUG)
|
||||||
popinfo("Debug: mojedb funkce spuštěna")
|
|
||||||
|
|
||||||
# Funkce pro stahování JSON souborů z GITu
|
# Funkce pro stahování JSON souborů z GITu
|
||||||
def update_json_db():
|
def update_json_db():
|
||||||
@@ -731,7 +730,6 @@ def mojedb(params):
|
|||||||
movies_dir = xbmcvfs.translatePath(os.path.join(_addon.getAddonInfo('path'), 'resources', 'movies'))
|
movies_dir = xbmcvfs.translatePath(os.path.join(_addon.getAddonInfo('path'), 'resources', 'movies'))
|
||||||
|
|
||||||
xbmc.log(f"Debug: Načítám seriály z: {series_dir}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Načítám seriály z: {series_dir}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Načítám seriály z: {series_dir}")
|
|
||||||
|
|
||||||
# Načti seznam souborů seriálů
|
# Načti seznam souborů seriálů
|
||||||
series_files = []
|
series_files = []
|
||||||
@@ -743,7 +741,6 @@ def mojedb(params):
|
|||||||
if os.path.exists(series_dir):
|
if os.path.exists(series_dir):
|
||||||
files = os.listdir(series_dir)
|
files = os.listdir(series_dir)
|
||||||
xbmc.log(f"Debug: Úspěšně načteno {len(files)} souborů z {series_dir}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Úspěšně načteno {len(files)} souborů z {series_dir}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Úspěšně načteno {len(files)} souborů")
|
|
||||||
for file in files:
|
for file in files:
|
||||||
xbmc.log(f"Debug: Kontroluji soubor: {file}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Kontroluji soubor: {file}", xbmc.LOGDEBUG)
|
||||||
if file.endswith('.json'):
|
if file.endswith('.json'):
|
||||||
@@ -751,13 +748,10 @@ def mojedb(params):
|
|||||||
xbmc.log(f"Debug: Přidán JSON soubor: {file}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Přidán JSON soubor: {file}", xbmc.LOGDEBUG)
|
||||||
else:
|
else:
|
||||||
xbmc.log(f"Debug: Složka neexistuje (os.path): {series_dir}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Složka neexistuje (os.path): {series_dir}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Složka neexistuje (os.path): {series_dir}")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
xbmc.log(f"Debug: Chyba při načítání složky {series_dir}: {str(e)}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Chyba při načítání složky {series_dir}: {str(e)}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Chyba při načítání složky: {str(e)}")
|
|
||||||
|
|
||||||
xbmc.log(f"Debug: Nalezeno {len(series_files)} JSON souborů seriálů", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Nalezeno {len(series_files)} JSON souborů seriálů", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Nalezeno {len(series_files)} JSON souborů seriálů")
|
|
||||||
for file in series_files:
|
for file in series_files:
|
||||||
xbmc.log(f"Debug: Seriál soubor: {file}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Seriál soubor: {file}", xbmc.LOGDEBUG)
|
||||||
|
|
||||||
@@ -781,7 +775,6 @@ def mojedb(params):
|
|||||||
# Výpis seriálů
|
# Výpis seriálů
|
||||||
elif params.get('type') == 'series' and not params.get('series_idx'):
|
elif params.get('type') == 'series' and not params.get('series_idx'):
|
||||||
xbmc.log(f"Debug: Zobrazuji seriály, nalezeno {len(series_files)} souborů", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Zobrazuji seriály, nalezeno {len(series_files)} souborů", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Zobrazuji seriály, nalezeno {len(series_files)} souborů")
|
|
||||||
for idx, file in enumerate(series_files):
|
for idx, file in enumerate(series_files):
|
||||||
try:
|
try:
|
||||||
xbmc.log(f"Debug: Načítám seriál: {file}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Načítám seriál: {file}", xbmc.LOGDEBUG)
|
||||||
@@ -815,7 +808,6 @@ def mojedb(params):
|
|||||||
try:
|
try:
|
||||||
series_idx = int(params['series_idx'])
|
series_idx = int(params['series_idx'])
|
||||||
series_file = series_files[series_idx]
|
series_file = series_files[series_idx]
|
||||||
popinfo(f"Debug: Zpracovávám seriál: {series_file}")
|
|
||||||
|
|
||||||
# Načti data seriálu
|
# Načti data seriálu
|
||||||
series_path = xbmcvfs.translatePath(os.path.join(_addon.getAddonInfo('path'), 'resources', 'series', series_file))
|
series_path = xbmcvfs.translatePath(os.path.join(_addon.getAddonInfo('path'), 'resources', 'series', series_file))
|
||||||
@@ -828,14 +820,12 @@ def mojedb(params):
|
|||||||
listitem = xbmcgui.ListItem(label=label)
|
listitem = xbmcgui.ListItem(label=label)
|
||||||
listitem.setArt({'icon': serie_data.get('icon', 'DefaultTVShows.png')})
|
listitem.setArt({'icon': serie_data.get('icon', 'DefaultTVShows.png')})
|
||||||
xbmcplugin.addDirectoryItem(_handle, get_url(action='mojedb', type='series', series_idx=series_idx, season_idx=idx), listitem, True)
|
xbmcplugin.addDirectoryItem(_handle, get_url(action='mojedb', type='series', series_idx=series_idx, season_idx=idx), listitem, True)
|
||||||
popinfo(f"Debug: Přidáno {len(serie_data.get('seasons', []))} sezón")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
popinfo(f"Chyba při zpracování sezón: {str(e)}", icon=xbmcgui.NOTIFICATION_ERROR, sound=True)
|
popinfo(f"Chyba při zpracování sezón: {str(e)}", icon=xbmcgui.NOTIFICATION_ERROR, sound=True)
|
||||||
|
|
||||||
# Výpis epizod dané sezóny
|
# Výpis epizod dané sezóny
|
||||||
elif params.get('type') == 'series' and params.get('series_idx') is not None and params.get('season_idx') is not None and not params.get('episode_idx'):
|
elif params.get('type') == 'series' and params.get('series_idx') is not None and params.get('season_idx') is not None and not params.get('episode_idx'):
|
||||||
xbmc.log("Debug: Zpracovávám seznam epizod", xbmc.LOGDEBUG)
|
xbmc.log("Debug: Zpracovávám seznam epizod", xbmc.LOGDEBUG)
|
||||||
popinfo("Debug: Zpracovávám seznam epizod")
|
|
||||||
try:
|
try:
|
||||||
series_idx = int(params['series_idx'])
|
series_idx = int(params['series_idx'])
|
||||||
series_file = series_files[series_idx]
|
series_file = series_files[series_idx]
|
||||||
@@ -862,7 +852,6 @@ def mojedb(params):
|
|||||||
# Vyhledání konkrétní epizody
|
# Vyhledání konkrétní epizody
|
||||||
elif params.get('type') == 'series' and params.get('series_idx') is not None and params.get('season_idx') is not None and params.get('episode_idx') is not None:
|
elif params.get('type') == 'series' and params.get('series_idx') is not None and params.get('season_idx') is not None and params.get('episode_idx') is not None:
|
||||||
xbmc.log("Debug: Zpracovávám epizodu", xbmc.LOGDEBUG)
|
xbmc.log("Debug: Zpracovávám epizodu", xbmc.LOGDEBUG)
|
||||||
popinfo("Debug: Zpracovávám epizodu")
|
|
||||||
try:
|
try:
|
||||||
series_idx = int(params['series_idx'])
|
series_idx = int(params['series_idx'])
|
||||||
series_file = series_files[series_idx]
|
series_file = series_files[series_idx]
|
||||||
@@ -878,7 +867,6 @@ def mojedb(params):
|
|||||||
season = serie_data['seasons'][season_idx]
|
season = serie_data['seasons'][season_idx]
|
||||||
episode = season['episodes'][episode_idx]
|
episode = season['episodes'][episode_idx]
|
||||||
xbmc.log(f"Debug: Epizoda: {episode['title']}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Epizoda: {episode['title']}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Epizoda: {episode['title']}")
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
xbmc.log(f"Chyba při zpracování epizody: {str(e)}", xbmc.LOGERROR)
|
xbmc.log(f"Chyba při zpracování epizody: {str(e)}", xbmc.LOGERROR)
|
||||||
popinfo(f"Chyba při zpracování epizody: {str(e)}", icon=xbmcgui.NOTIFICATION_ERROR, sound=True)
|
popinfo(f"Chyba při zpracování epizody: {str(e)}", icon=xbmcgui.NOTIFICATION_ERROR, sound=True)
|
||||||
@@ -886,10 +874,8 @@ def mojedb(params):
|
|||||||
return
|
return
|
||||||
if 'ident' in episode:
|
if 'ident' in episode:
|
||||||
xbmc.log(f"Debug: Nalezen ident: {episode['ident']}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Nalezen ident: {episode['ident']}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Nalezen ident: {episode['ident']}")
|
|
||||||
if verify_ident(episode['ident'], token):
|
if verify_ident(episode['ident'], token):
|
||||||
xbmc.log("Debug: Ident je platný, vytvářím přehrávatelnou položku", xbmc.LOGDEBUG)
|
xbmc.log("Debug: Ident je platný, vytvářím přehrávatelnou položku", xbmc.LOGDEBUG)
|
||||||
popinfo("Debug: Ident je platný, vytvářím přehrávatelnou položku")
|
|
||||||
# Vytvoř přehrávatelnou položku
|
# Vytvoř přehrávatelnou položku
|
||||||
listitem = xbmcgui.ListItem(label=episode['title'])
|
listitem = xbmcgui.ListItem(label=episode['title'])
|
||||||
listitem.setArt({'icon': serie_data.get('icon', 'DefaultTVShows.png')})
|
listitem.setArt({'icon': serie_data.get('icon', 'DefaultTVShows.png')})
|
||||||
@@ -898,12 +884,10 @@ def mojedb(params):
|
|||||||
xbmcplugin.addDirectoryItem(_handle, get_url(action='play', ident=episode['ident'], name=episode['title']), listitem, False)
|
xbmcplugin.addDirectoryItem(_handle, get_url(action='play', ident=episode['ident'], name=episode['title']), listitem, False)
|
||||||
# Ukonči adresář bez volání endOfDirectory na konci
|
# Ukonči adresář bez volání endOfDirectory na konci
|
||||||
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
||||||
popinfo("Debug: Ukončuji mojedb funkci")
|
|
||||||
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
xbmc.log("Debug: Ident není platný, zobrazuji výsledky vyhledávání", xbmc.LOGDEBUG)
|
xbmc.log("Debug: Ident není platný, zobrazuji výsledky vyhledávání", xbmc.LOGDEBUG)
|
||||||
popinfo("Debug: Ident není platný, zobrazuji výsledky vyhledávání")
|
|
||||||
# Pokud ident není platný, použij vyhledávání
|
# Pokud ident není platný, použij vyhledávání
|
||||||
what = episode['search']
|
what = episode['search']
|
||||||
category = 'video'
|
category = 'video'
|
||||||
@@ -912,7 +896,6 @@ def mojedb(params):
|
|||||||
offset = 0
|
offset = 0
|
||||||
dosearch(token, what, category, sort, limit, offset, 'search')
|
dosearch(token, what, category, sort, limit, offset, 'search')
|
||||||
else:
|
else:
|
||||||
popinfo("Debug: Není ident, zobrazuji výsledky vyhledávání")
|
|
||||||
what = episode['search']
|
what = episode['search']
|
||||||
category = 'video'
|
category = 'video'
|
||||||
sort = 'recent'
|
sort = 'recent'
|
||||||
@@ -940,11 +923,9 @@ def mojedb(params):
|
|||||||
xbmcplugin.addDirectoryItem(_handle, get_url(action='play', ident=movie['ident'], name=movie['title']), listitem, False)
|
xbmcplugin.addDirectoryItem(_handle, get_url(action='play', ident=movie['ident'], name=movie['title']), listitem, False)
|
||||||
# Ukonči adresář bez volání endOfDirectory na konci
|
# Ukonči adresář bez volání endOfDirectory na konci
|
||||||
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
||||||
popinfo("Debug: Ukončuji mojedb funkci")
|
|
||||||
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
popinfo("Debug: Ident filmu není platný, zobrazuji výsledky vyhledávání")
|
|
||||||
# Pokud ident není platný, použij vyhledávání
|
# Pokud ident není platný, použij vyhledávání
|
||||||
what = movie['search']
|
what = movie['search']
|
||||||
category = 'video'
|
category = 'video'
|
||||||
@@ -953,7 +934,6 @@ def mojedb(params):
|
|||||||
offset = 0
|
offset = 0
|
||||||
dosearch(token, what, category, sort, limit, offset, 'search')
|
dosearch(token, what, category, sort, limit, offset, 'search')
|
||||||
else:
|
else:
|
||||||
popinfo("Debug: Film nemá ident, zobrazuji výsledky vyhledávání")
|
|
||||||
what = movie['search']
|
what = movie['search']
|
||||||
category = 'video'
|
category = 'video'
|
||||||
sort = 'recent'
|
sort = 'recent'
|
||||||
@@ -962,7 +942,6 @@ def mojedb(params):
|
|||||||
dosearch(token, what, category, sort, limit, offset, 'search')
|
dosearch(token, what, category, sort, limit, offset, 'search')
|
||||||
|
|
||||||
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
xbmcplugin.addSortMethod(_handle, xbmcplugin.SORT_METHOD_LABEL)
|
||||||
popinfo("Debug: Ukončuji mojedb funkci")
|
|
||||||
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
xbmcplugin.endOfDirectory(_handle, updateListing=updateListing)
|
||||||
|
|
||||||
def menu():
|
def menu():
|
||||||
@@ -1002,7 +981,6 @@ def router(paramstring):
|
|||||||
if params:
|
if params:
|
||||||
action = params.get('action', 'none')
|
action = params.get('action', 'none')
|
||||||
xbmc.log(f"Debug: Router - action: {action}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Router - action: {action}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Router - action: {action}")
|
|
||||||
|
|
||||||
if action == 'search':
|
if action == 'search':
|
||||||
search(params)
|
search(params)
|
||||||
@@ -1022,7 +1000,6 @@ def router(paramstring):
|
|||||||
db(params)
|
db(params)
|
||||||
elif action == 'mojedb':
|
elif action == 'mojedb':
|
||||||
xbmc.log(f"Debug: Router - volám mojedb s parametry: {params}", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Router - volám mojedb s parametry: {params}", xbmc.LOGDEBUG)
|
||||||
popinfo(f"Debug: Router - volám mojedb")
|
|
||||||
mojedb(params)
|
mojedb(params)
|
||||||
else:
|
else:
|
||||||
xbmc.log(f"Debug: Router - neznámá akce: {action}, volám menu", xbmc.LOGDEBUG)
|
xbmc.log(f"Debug: Router - neznámá akce: {action}, volám menu", xbmc.LOGDEBUG)
|
||||||
|
|||||||
Reference in New Issue
Block a user