Delete genres in Kodi DB
This commit is contained in:
parent
eedabf5888
commit
bad32e90ab
2 changed files with 12 additions and 0 deletions
|
@ -482,6 +482,7 @@ class Movies(Items):
|
||||||
if kodi_type == v.KODI_TYPE_MOVIE:
|
if kodi_type == v.KODI_TYPE_MOVIE:
|
||||||
self.kodi_db.delete_countries(kodi_id, kodi_type)
|
self.kodi_db.delete_countries(kodi_id, kodi_type)
|
||||||
self.kodi_db.delete_people(kodi_id, kodi_type)
|
self.kodi_db.delete_people(kodi_id, kodi_type)
|
||||||
|
self.kodi_db.delete_genre(kodi_id, kodi_type)
|
||||||
# Delete kodi movie and file
|
# Delete kodi movie and file
|
||||||
kodicursor.execute("DELETE FROM movie WHERE idMovie = ?",
|
kodicursor.execute("DELETE FROM movie WHERE idMovie = ?",
|
||||||
(kodi_id,))
|
(kodi_id,))
|
||||||
|
@ -1205,6 +1206,7 @@ class TVShows(Items):
|
||||||
Remove a TV show, and only the show, no seasons or episodes
|
Remove a TV show, and only the show, no seasons or episodes
|
||||||
"""
|
"""
|
||||||
kodicursor = self.kodicursor
|
kodicursor = self.kodicursor
|
||||||
|
self.kodi_db.delete_genre(kodi_id, v.KODI_TYPE_SHOW)
|
||||||
self.artwork.deleteArtwork(kodi_id, v.KODI_TYPE_SHOW, kodicursor)
|
self.artwork.deleteArtwork(kodi_id, v.KODI_TYPE_SHOW, kodicursor)
|
||||||
kodicursor.execute("DELETE FROM tvshow WHERE idShow = ?", (kodi_id,))
|
kodicursor.execute("DELETE FROM tvshow WHERE idShow = ?", (kodi_id,))
|
||||||
if v.KODIVERSION >= 17:
|
if v.KODIVERSION >= 17:
|
||||||
|
|
|
@ -506,6 +506,16 @@ class KodiDBMethods(object):
|
||||||
'''
|
'''
|
||||||
self.cursor.execute(query, (genre_id, kodi_id, kodi_type))
|
self.cursor.execute(query, (genre_id, kodi_id, kodi_type))
|
||||||
|
|
||||||
|
def delete_genre(self, kodi_id, kodi_type):
|
||||||
|
"""
|
||||||
|
Removes the genre links as well as orphaned genres from the Kodi DB
|
||||||
|
"""
|
||||||
|
self._delete_from_link_and_table(kodi_id,
|
||||||
|
kodi_type,
|
||||||
|
'genre_link',
|
||||||
|
'genre',
|
||||||
|
'genre_id')
|
||||||
|
|
||||||
def addStudios(self, kodiid, studios, mediatype):
|
def addStudios(self, kodiid, studios, mediatype):
|
||||||
for studio in studios:
|
for studio in studios:
|
||||||
query = ' '.join((
|
query = ' '.join((
|
||||||
|
|
Loading…
Add table
Reference in a new issue