mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
fix: added maps to getKoditvshows method
This commit is contained in:
parent
58ad5c1fe3
commit
a20ccc1cc8
1 changed files with 23 additions and 13 deletions
|
@ -79,17 +79,16 @@ class ReadKodiDB():
|
|||
def getKodiTvShowsIds(self,returnMB3Ids = False):
|
||||
# returns a list of tvshowIds or MB3 Id's from all tvshows currently in the Kodi library
|
||||
allKodiTvShows = self.getKodiTvShows(False)
|
||||
allKodiTvShowsIds = list()
|
||||
|
||||
if allKodiTvShows != None:
|
||||
for kodishow in allKodiTvShows:
|
||||
if returnMB3Ids:
|
||||
filepath = kodishow["file"]
|
||||
filepath = filepath.replace(tvLibrary + os.sep, "")
|
||||
filepath = filepath.replace(".strm", "")
|
||||
filepath = filepath.split(os.sep)[0]
|
||||
id = filepath
|
||||
if allKodiTvShows == None:
|
||||
return list()
|
||||
|
||||
if(returnMB3Ids):
|
||||
allKodiTvShowsIds = list(allKodiTvShows.keys())
|
||||
return allKodiTvShowsIds
|
||||
else:
|
||||
allKodiTvShowsIds = list()
|
||||
for kodishow in allKodiTvShows.values():
|
||||
id = str(kodishow["tvshowid"])
|
||||
allKodiTvShowsIds.append(id)
|
||||
|
||||
|
@ -110,7 +109,18 @@ class ReadKodiDB():
|
|||
if(result.has_key('tvshows')):
|
||||
tvshows = result['tvshows']
|
||||
|
||||
return tvshows
|
||||
kodiShowMap = None
|
||||
if(tvshows != None and len(tvshows) > 0):
|
||||
kodiShowMap = {}
|
||||
for kodishow in tvshows:
|
||||
filepath = kodishow["file"]
|
||||
filepath = filepath.replace(tvLibrary + os.sep, "")
|
||||
filepath = filepath.replace(".strm", "")
|
||||
filepath = filepath.split(os.sep)[0]
|
||||
key = filepath #extract the id from the file path
|
||||
kodiShowMap[key] = kodishow
|
||||
|
||||
return kodiShowMap
|
||||
|
||||
def getKodiTVShow(self, id):
|
||||
xbmc.sleep(sleepVal)
|
||||
|
|
Loading…
Reference in a new issue