Fix ratings for movies

- Fixes #71
This commit is contained in:
tomkat83 2017-02-19 15:57:31 +01:00
parent 68e1e6facd
commit 983fd168bb

View file

@ -316,14 +316,14 @@ class Movies(Items):
# Update the movie entry # Update the movie entry
if v.KODIVERSION >= 17: if v.KODIVERSION >= 17:
# update new ratings Kodi 17 # update new ratings Kodi 17
ratingid = self.kodi_db.get_ratingid(movieid, rating_id = self.kodi_db.get_ratingid(movieid,
v.KODI_TYPE_MOVIE) v.KODI_TYPE_MOVIE)
self.kodi_db.update_ratings(movieid, self.kodi_db.update_ratings(movieid,
v.KODI_TYPE_MOVIE, v.KODI_TYPE_MOVIE,
"default", "default",
rating, rating,
votecount, votecount,
ratingid) rating_id)
# 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) v.KODI_TYPE_MOVIE)
@ -342,10 +342,10 @@ class Movies(Items):
WHERE idMovie = ? WHERE idMovie = ?
''' '''
kodicursor.execute(query, (title, plot, shortplot, tagline, kodicursor.execute(query, (title, plot, shortplot, tagline,
votecount, rating, writer, year, imdb, sorttitle, runtime, votecount, rating_id, writer, year, imdb, sorttitle,
mpaa, genre, director, title, studio, trailer, country, runtime, mpaa, genre, director, title, studio, trailer,
playurl, pathid, fileid, year, userdata['UserRating'], country, playurl, pathid, fileid, year,
movieid)) userdata['UserRating'], movieid))
else: else:
query = ''' query = '''
UPDATE movie UPDATE movie
@ -365,7 +365,8 @@ class Movies(Items):
log.info("ADD movie itemid: %s - Title: %s" % (itemid, title)) log.info("ADD movie itemid: %s - Title: %s" % (itemid, title))
if v.KODIVERSION >= 17: if v.KODIVERSION >= 17:
# add new ratings Kodi 17 # add new ratings Kodi 17
self.kodi_db.add_ratings(self.kodi_db.create_entry_rating(), rating_id = self.kodi_db.create_entry_rating()
self.kodi_db.add_ratings(rating_id,
movieid, movieid,
v.KODI_TYPE_MOVIE, v.KODI_TYPE_MOVIE,
"default", "default",
@ -385,9 +386,9 @@ class Movies(Items):
?, ?, ?, ?, ?, ?, ?) ?, ?, ?, ?, ?, ?, ?)
''' '''
kodicursor.execute(query, (movieid, fileid, title, plot, kodicursor.execute(query, (movieid, fileid, title, plot,
shortplot, tagline, votecount, rating, writer, year, imdb, shortplot, tagline, votecount, rating_id, writer, year,
sorttitle, runtime, mpaa, genre, director, title, studio, imdb, sorttitle, runtime, mpaa, genre, director, title,
trailer, country, playurl, pathid, year, studio, trailer, country, playurl, pathid, year,
userdata['UserRating'])) userdata['UserRating']))
else: else:
query = ''' query = '''