Fix getting unique id

This commit is contained in:
tomkat83 2017-02-13 20:26:30 +01:00
parent 9612ee78ab
commit 922f4150a0
2 changed files with 11 additions and 6 deletions

View file

@ -323,7 +323,8 @@ class Movies(Items):
votecount, votecount,
ratingid) ratingid)
# update new uniqueid Kodi 17 # update new uniqueid Kodi 17
uniqueid = self.kodi_db.get_uniqueid(movieid) uniqueid = self.kodi_db.get_uniqueid(movieid,
v.KODI_TYPE_MOVIE)
self.kodi_db.update_uniqueid(movieid, self.kodi_db.update_uniqueid(movieid,
v.KODI_TYPE_MOVIE, v.KODI_TYPE_MOVIE,
imdb, imdb,
@ -605,7 +606,7 @@ class TVShows(Items):
None, # votecount None, # votecount
ratingid) ratingid)
# update new uniqueid Kodi 17 # update new uniqueid Kodi 17
uniqueid = self.kodi_db.get_uniqueid(showid) uniqueid = self.kodi_db.get_uniqueid(showid, v.KODI_TYPE_SHOW)
self.kodi_db.update_uniqueid(showid, self.kodi_db.update_uniqueid(showid,
v.KODI_TYPE_SHOW, v.KODI_TYPE_SHOW,
tvdb, tvdb,
@ -927,7 +928,8 @@ class TVShows(Items):
votecount, votecount,
ratingid) ratingid)
# update new uniqueid Kodi 17 # update new uniqueid Kodi 17
uniqueid = self.kodi_db.get_uniqueid(episodeid) uniqueid = self.kodi_db.get_uniqueid(episodeid,
v.KODI_TYPE_EPISODE)
self.kodi_db.update_uniqueid(episodeid, self.kodi_db.update_uniqueid(episodeid,
v.KODI_TYPE_EPISODE, v.KODI_TYPE_EPISODE,
tvdb, tvdb,

View file

@ -1434,9 +1434,12 @@ class Kodidb_Functions():
''' '''
self.cursor.execute(query, (args)) self.cursor.execute(query, (args))
def get_uniqueid(self, media_id): def get_uniqueid(self, kodi_id, kodi_type):
query = "SELECT uniqueid_id FROM uniqueid WHERE media_id = ?" query = '''
self.cursor.execute(query, (media_id,)) SELECT uniqueid_id FROM uniqueid
WHERE media_id = ? AND media_type = ?
'''
self.cursor.execute(query, (kodi_id, kodi_type))
try: try:
uniqueid = self.cursor.fetchone()[0] uniqueid = self.cursor.fetchone()[0]
except TypeError: except TypeError: