Clean Kodi DB more thoroughly after playback start via PMS

This commit is contained in:
croneter 2018-03-16 07:52:49 +01:00
parent 600a22d158
commit bb2f4601f5

View file

@ -210,7 +210,18 @@ class KodiDBMethods(object):
but without a dateAdded entry. This method cleans up all file entries
without a dateAdded entry - to be called after playback has ended.
"""
self.cursor.execute('SELECT idFile FROM files WHERE dateAdded IS NULL')
files = self.cursor.fetchall()
self.cursor.execute('DELETE FROM files where dateAdded IS NULL')
for file in files:
self.cursor.execute('DELETE FROM bookmark WHERE idFile = ?',
(file[0],))
self.cursor.execute('DELETE FROM settings WHERE idFile = ?',
(file[0],))
self.cursor.execute('DELETE FROM streamdetails WHERE idFile = ?',
(file[0],))
self.cursor.execute('DELETE FROM stacktimes WHERE idFile = ?',
(file[0],))
def remove_file(self, file_id):
"""