Account for missing TheTVDB ids

This commit is contained in:
tomkat83 2017-05-01 10:08:23 +02:00
parent b715b16f05
commit 431e95706f

View file

@ -617,12 +617,16 @@ class TVShows(Items):
votecount, votecount,
rating_id) rating_id)
# update new uniqueid Kodi 17 # update new uniqueid Kodi 17
uniqueid = self.kodi_db.get_uniqueid(showid, v.KODI_TYPE_SHOW) if tvdb is not None:
self.kodi_db.update_uniqueid(showid, uniqueid = self.kodi_db.get_uniqueid(showid,
v.KODI_TYPE_SHOW, v.KODI_TYPE_SHOW)
tvdb, self.kodi_db.update_uniqueid(showid,
"unknown", v.KODI_TYPE_SHOW,
uniqueid) tvdb,
"unknown",
uniqueid)
else:
uniqueid = -1
# Update the tvshow entry # Update the tvshow entry
query = ''' query = '''
UPDATE tvshow UPDATE tvshow
@ -680,12 +684,15 @@ class TVShows(Items):
rating, rating,
votecount) votecount)
# add new uniqueid Kodi 17 # add new uniqueid Kodi 17
uniqueid = self.kodi_db.create_entry_uniqueid() if tvdb is not None:
self.kodi_db.add_uniqueid(uniqueid, uniqueid = self.kodi_db.create_entry_uniqueid()
showid, self.kodi_db.add_uniqueid(uniqueid,
v.KODI_TYPE_SHOW, showid,
tvdb, v.KODI_TYPE_SHOW,
"unknown") tvdb,
"unknown")
else:
uniqueid = -1
# Create the tvshow entry # Create the tvshow entry
query = ''' query = '''
INSERT INTO tvshow( INSERT INTO tvshow(