Fix AttributeError on PKC DB reset

This commit is contained in:
croneter 2018-11-05 18:18:46 +01:00
parent e4c9a7a259
commit 0fa8fe1144

View file

@ -518,14 +518,14 @@ def wipe_database():
delete_nodes()
from . import kodidb_functions
kodidb_functions.wipe_dbs()
from .plex_db import PlexDB
from . import plex_db
# First get the paths to all synced playlists
playlist_paths = []
with PlexDB() as plex_db:
plex_db.cursor.execute('SELECT kodi_path FROM playlists')
for entry in plex_db.cursor:
with plex_db.PlexDB() as plexdb:
plexdb.cursor.execute('SELECT kodi_path FROM playlists')
for entry in plexdb.cursor:
playlist_paths.append(entry[0])
PlexDB.wipe()
plex_db.wipe()
# Delete all synced playlists
for path in playlist_paths:
try: