fix showid

In case the show id somehow changes, allow value to be updated for
episodes
This commit is contained in:
angelblue05 2016-10-07 22:26:51 -05:00
parent 584711384f
commit 29fcc2569e

View file

@ -1396,23 +1396,23 @@ class TVShows(Items):
"UPDATE episode", "UPDATE episode",
"SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?,", "SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?,",
"c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?, idSeason = ?", "c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?, idSeason = ?, idShow = ?",
"WHERE idEpisode = ?" "WHERE idEpisode = ?"
)) ))
kodicursor.execute(query, (title, plot, rating, writer, premieredate, kodicursor.execute(query, (title, plot, rating, writer, premieredate,
runtime, director, season, episode, title, airsBeforeSeason, runtime, director, season, episode, title, airsBeforeSeason,
airsBeforeEpisode, seasonid, episodeid)) airsBeforeEpisode, seasonid, showid, episodeid))
else: else:
query = ' '.join(( query = ' '.join((
"UPDATE episode", "UPDATE episode",
"SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?,", "SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?,",
"c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?", "c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?, idShow = ?",
"WHERE idEpisode = ?" "WHERE idEpisode = ?"
)) ))
kodicursor.execute(query, (title, plot, rating, writer, premieredate, kodicursor.execute(query, (title, plot, rating, writer, premieredate,
runtime, director, season, episode, title, airsBeforeSeason, runtime, director, season, episode, title, airsBeforeSeason,
airsBeforeEpisode, episodeid)) airsBeforeEpisode, showid, episodeid))
# Update the checksum in emby table # Update the checksum in emby table
emby_db.updateReference(itemid, checksum) emby_db.updateReference(itemid, checksum)