mirror of
https://github.com/jellyfin/jellyfin-kodi.git
synced 2024-12-25 10:16:11 +00:00
Fixed uniqueID and ratingID issues (#95)
* Fixed uniqueID and ratingID issues * cleanup
This commit is contained in:
parent
21e7a9cada
commit
71da2bf777
4 changed files with 16 additions and 16 deletions
|
@ -115,8 +115,8 @@ class KodiMovies(KodiItems):
|
|||
|
||||
def get_ratingid(self, media_id):
|
||||
|
||||
query = "SELECT rating_id FROM rating WHERE media_id = ?"
|
||||
self.cursor.execute(query, (media_id,))
|
||||
query = "SELECT rating_id FROM rating WHERE media_type = ? AND media_id = ?"
|
||||
self.cursor.execute(query, ("movie", media_id,))
|
||||
try:
|
||||
ratingid = self.cursor.fetchone()[0]
|
||||
except TypeError:
|
||||
|
@ -146,8 +146,8 @@ class KodiMovies(KodiItems):
|
|||
|
||||
def get_uniqueid(self, media_id):
|
||||
|
||||
query = "SELECT uniqueid_id FROM uniqueid WHERE media_id = ?"
|
||||
self.cursor.execute(query, (media_id,))
|
||||
query = "SELECT uniqueid_id FROM uniqueid WHERE media_type = ? AND media_id = ?"
|
||||
self.cursor.execute(query, ("movie", media_id,))
|
||||
try:
|
||||
uniqueid = self.cursor.fetchone()[0]
|
||||
except TypeError:
|
||||
|
|
|
@ -74,10 +74,10 @@ class KodiTVShows(KodiItems):
|
|||
|
||||
return kodi_id
|
||||
|
||||
def get_ratingid(self, media_id):
|
||||
def get_ratingid(self, media_type, media_id):
|
||||
|
||||
query = "SELECT rating_id FROM rating WHERE media_id = ?"
|
||||
self.cursor.execute(query, (media_id,))
|
||||
query = "SELECT rating_id FROM rating WHERE media_type = ? AND media_id = ?"
|
||||
self.cursor.execute(query, (media_type, media_id,))
|
||||
try:
|
||||
ratingid = self.cursor.fetchone()[0]
|
||||
except TypeError:
|
||||
|
@ -105,10 +105,10 @@ class KodiTVShows(KodiItems):
|
|||
))
|
||||
self.cursor.execute(query, (args))
|
||||
|
||||
def get_uniqueid(self, media_id):
|
||||
def get_uniqueid(self, media_type, media_id):
|
||||
|
||||
query = "SELECT uniqueid_id FROM uniqueid WHERE media_id = ?"
|
||||
self.cursor.execute(query, (media_id,))
|
||||
query = "SELECT uniqueid_id FROM uniqueid WHERE media_type = ? AND media_id = ?"
|
||||
self.cursor.execute(query, (media_type, media_id,))
|
||||
try:
|
||||
uniqueid = self.cursor.fetchone()[0]
|
||||
except TypeError:
|
||||
|
|
|
@ -243,13 +243,13 @@ class Movies(Items):
|
|||
if self.kodi_version >= 17:
|
||||
ratingid = self.kodi_db.get_ratingid(movieid)
|
||||
|
||||
self.kodi_db.update_ratings(movieid, "movie", "default", rating, votecount,ratingid)
|
||||
self.kodi_db.update_ratings(movieid, "movie", "default", rating, votecount, ratingid)
|
||||
|
||||
# update new uniqueid Kodi 17
|
||||
if self.kodi_version >= 17:
|
||||
uniqueid = self.kodi_db.get_uniqueid(movieid)
|
||||
|
||||
self.kodi_db.update_uniqueid(movieid, "movie", imdb, "imdb",uniqueid)
|
||||
self.kodi_db.update_uniqueid(movieid, "movie", imdb, "imdb", uniqueid)
|
||||
|
||||
# Update the movie entry
|
||||
if self.kodi_version >= 17:
|
||||
|
|
|
@ -344,13 +344,13 @@ class TVShows(Items):
|
|||
|
||||
# update new ratings Kodi 17
|
||||
if self.kodi_version > 16:
|
||||
ratingid = self.kodi_db.get_ratingid(showid)
|
||||
ratingid = self.kodi_db.get_ratingid("tvshow", showid)
|
||||
|
||||
self.kodi_db.update_ratings(showid, "tvshow", "default", rating, votecount,ratingid)
|
||||
|
||||
# update new uniqueid Kodi 17
|
||||
if self.kodi_version > 16:
|
||||
uniqueid = self.kodi_db.get_uniqueid(showid)
|
||||
uniqueid = self.kodi_db.get_uniqueid("tvshow", showid)
|
||||
|
||||
self.kodi_db.update_uniqueid(showid, "tvshow", imdb, "imdb",uniqueid)
|
||||
|
||||
|
@ -609,13 +609,13 @@ class TVShows(Items):
|
|||
|
||||
# update new ratings Kodi 17
|
||||
if self.kodi_version >= 17:
|
||||
ratingid = self.kodi_db.get_ratingid(episodeid)
|
||||
ratingid = self.kodi_db.get_ratingid("episode", episodeid)
|
||||
|
||||
self.kodi_db.update_ratings(episodeid, "episode", "default", rating, votecount,ratingid)
|
||||
|
||||
# update new uniqueid Kodi 17
|
||||
if self.kodi_version >= 17:
|
||||
uniqueid = self.kodi_db.get_uniqueid(episodeid)
|
||||
uniqueid = self.kodi_db.get_uniqueid("episode", episodeid)
|
||||
|
||||
self.kodi_db.update_uniqueid(episodeid, "episode", tvdb, "tvdb",uniqueid)
|
||||
|
||||
|
|
Loading…
Reference in a new issue