mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-11-12 21:26:10 +00:00
Use the Emby ID as the key to look up Episodes
This commit is contained in:
parent
2112ab951b
commit
11218b7891
2 changed files with 4 additions and 10 deletions
|
@ -382,11 +382,8 @@ class LibrarySync():
|
||||||
userData = API().getUserData(episode)
|
userData = API().getUserData(episode)
|
||||||
WINDOW.setProperty("EmbyUserKey" + userData.get("Key"), episode.get('Id') + ";;" + episode.get("Type"))
|
WINDOW.setProperty("EmbyUserKey" + userData.get("Key"), episode.get('Id') + ";;" + episode.get("Type"))
|
||||||
|
|
||||||
#we have to compare the lists somehow
|
|
||||||
comparestring1 = str(episode.get("ParentIndexNumber")) + "-" + str(episode.get("IndexNumber"))
|
|
||||||
|
|
||||||
if kodiEpisodes != None:
|
if kodiEpisodes != None:
|
||||||
KodiItem = kodiEpisodes.get(comparestring1, None)
|
KodiItem = kodiEpisodes.get(episode.get("Id"), None)
|
||||||
if(KodiItem != None):
|
if(KodiItem != None):
|
||||||
WriteKodiDB().updateEpisodeToKodiLibrary(episode, KodiItem, connection, cursor)
|
WriteKodiDB().updateEpisodeToKodiLibrary(episode, KodiItem, connection, cursor)
|
||||||
|
|
||||||
|
@ -531,14 +528,13 @@ class LibrarySync():
|
||||||
#add episodeId to the list of all episodes for use later on the deletes
|
#add episodeId to the list of all episodes for use later on the deletes
|
||||||
allMB3EpisodeIds.append(item["Id"])
|
allMB3EpisodeIds.append(item["Id"])
|
||||||
|
|
||||||
comparestring1 = str(item.get("ParentIndexNumber")) + "-" + str(item.get("IndexNumber"))
|
|
||||||
matchFound = False
|
matchFound = False
|
||||||
|
|
||||||
userData = API().getUserData(item)
|
userData = API().getUserData(item)
|
||||||
WINDOW.setProperty("EmbyUserKey" + userData.get("Key"), item.get('Id') + ";;" + item.get("Type"))
|
WINDOW.setProperty("EmbyUserKey" + userData.get("Key"), item.get('Id') + ";;" + item.get("Type"))
|
||||||
|
|
||||||
if kodiEpisodes != None:
|
if kodiEpisodes != None:
|
||||||
KodiItem = kodiEpisodes.get(comparestring1, None)
|
KodiItem = kodiEpisodes.get(item.get("Id"), None)
|
||||||
if(KodiItem != None):
|
if(KodiItem != None):
|
||||||
updated = WriteKodiDB().updateEpisodeToKodiLibrary(item, KodiItem, connection, cursor)
|
updated = WriteKodiDB().updateEpisodeToKodiLibrary(item, KodiItem, connection, cursor)
|
||||||
if(updated):
|
if(updated):
|
||||||
|
@ -863,10 +859,9 @@ class LibrarySync():
|
||||||
for episode in episodeData:
|
for episode in episodeData:
|
||||||
|
|
||||||
kodiItem = None
|
kodiItem = None
|
||||||
comparestring1 = str(episode.get("ParentIndexNumber")) + "-" + str(episode.get("IndexNumber"))
|
|
||||||
matchFound = False
|
matchFound = False
|
||||||
if kodiEpisodes != None:
|
if kodiEpisodes != None:
|
||||||
kodiItem = kodiEpisodes.get(comparestring1, None)
|
kodiItem = kodiEpisodes.get(episode.get("Id"), None)
|
||||||
|
|
||||||
userData=API().getUserData(episode)
|
userData=API().getUserData(episode)
|
||||||
timeInfo = API().getTimeInfo(episode)
|
timeInfo = API().getTimeInfo(episode)
|
||||||
|
|
|
@ -189,8 +189,7 @@ class ReadKodiDB():
|
||||||
if(episodes != None):
|
if(episodes != None):
|
||||||
episodeMap = {}
|
episodeMap = {}
|
||||||
for KodiItem in episodes:
|
for KodiItem in episodes:
|
||||||
key = str(KodiItem["season"]) + "-" + str(KodiItem["episode"])
|
episodeMap[KodiItem["uniqueid"]["unknown"]] = KodiItem
|
||||||
episodeMap[key] = KodiItem
|
|
||||||
return episodeMap
|
return episodeMap
|
||||||
else:
|
else:
|
||||||
return episodes
|
return episodes
|
||||||
|
|
Loading…
Reference in a new issue