Quick hack to get sets working
This commit is contained in:
parent
5e95a34164
commit
7ac7b1db31
2 changed files with 8 additions and 1 deletions
|
@ -530,6 +530,8 @@ class Movies(Items):
|
||||||
if userdata['Favorite']:
|
if userdata['Favorite']:
|
||||||
tags.append("Favorite movies")
|
tags.append("Favorite movies")
|
||||||
self.kodi_db.addTags(movieid, tags, "movie")
|
self.kodi_db.addTags(movieid, tags, "movie")
|
||||||
|
# Add any sets from Plex collection tags
|
||||||
|
self.kodi_db.addSets(movieid, collections)
|
||||||
# Process playstates
|
# Process playstates
|
||||||
self.kodi_db.addPlaystate(fileid, resume, runtime, playcount, dateplayed)
|
self.kodi_db.addPlaystate(fileid, resume, runtime, playcount, dateplayed)
|
||||||
|
|
||||||
|
|
|
@ -1181,6 +1181,11 @@ class Kodidb_Functions():
|
||||||
))
|
))
|
||||||
self.cursor.execute(query, (kodiid, mediatype, tag_id,))
|
self.cursor.execute(query, (kodiid, mediatype, tag_id,))
|
||||||
|
|
||||||
|
def addSets(self, movieid, collections):
|
||||||
|
for setname in collections:
|
||||||
|
setid = self.createBoxset(setname)
|
||||||
|
self.assignBoxset(setid, movieid)
|
||||||
|
|
||||||
def createBoxset(self, boxsetname):
|
def createBoxset(self, boxsetname):
|
||||||
|
|
||||||
self.logMsg("Adding boxset: %s" % boxsetname, 2)
|
self.logMsg("Adding boxset: %s" % boxsetname, 2)
|
||||||
|
@ -1386,4 +1391,4 @@ class Kodidb_Functions():
|
||||||
self.cursor.execute(query, (genreid, genre))
|
self.cursor.execute(query, (genreid, genre))
|
||||||
|
|
||||||
query = "INSERT OR REPLACE INTO song_genre(idGenre, idSong) values(?, ?)"
|
query = "INSERT OR REPLACE INTO song_genre(idGenre, idSong) values(?, ?)"
|
||||||
self.cursor.execute(query, (genreid, kodiid))
|
self.cursor.execute(query, (genreid, kodiid))
|
||||||
|
|
Loading…
Reference in a new issue