From 9101f49895045dd5c27ff71edd37c077f7e4c35e Mon Sep 17 00:00:00 2001 From: croneter Date: Sun, 11 Mar 2018 12:00:28 +0100 Subject: [PATCH] Cleanly remove all file references --- resources/lib/itemtypes.py | 8 ++------ resources/lib/kodidb_functions.py | 6 ------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/resources/lib/itemtypes.py b/resources/lib/itemtypes.py index 73c727ac..8dd0ae0a 100644 --- a/resources/lib/itemtypes.py +++ b/resources/lib/itemtypes.py @@ -479,13 +479,10 @@ class Movies(Items): self.kodi_db.modify_genres(kodi_id, kodi_type) self.kodi_db.modify_studios(kodi_id, kodi_type) self.kodi_db.modify_tags(kodi_id, kodi_type) - self.kodi_db.modify_streams(file_id) - self.kodi_db.delete_playstate(file_id) # Delete kodi movie and file + self.kodi_db.remove_file(file_id) kodicursor.execute("DELETE FROM movie WHERE idMovie = ?", (kodi_id,)) - kodicursor.execute("DELETE FROM files WHERE idFile = ?", - (file_id,)) if set_id: self.kodi_db.delete_possibly_empty_set(set_id) if v.KODIVERSION >= 17: @@ -1149,8 +1146,7 @@ class TVShows(Items): """ kodicursor = self.kodicursor self.kodi_db.modify_people(kodi_id, v.KODI_TYPE_EPISODE) - self.kodi_db.modify_streams(file_id) - self.kodi_db.delete_playstate(file_id) + self.kodi_db.remove_file(file_id) self.artwork.delete_artwork(kodi_id, "episode", kodicursor) kodicursor.execute("DELETE FROM episode WHERE idEpisode = ?", (kodi_id,)) diff --git a/resources/lib/kodidb_functions.py b/resources/lib/kodidb_functions.py index 8d1765ba..e2e2867a 100644 --- a/resources/lib/kodidb_functions.py +++ b/resources/lib/kodidb_functions.py @@ -686,12 +686,6 @@ class KodiDBMethods(object): '', 1)) - def delete_playstate(self, file_id): - """ - Removes all playstates/bookmarks for the file with file_id - """ - self.cursor.execute('DELETE FROM bookmark where idFile = ?', (file_id,)) - def createTag(self, name): # This will create and return the tag_id query = ' '.join((