Don't import DatabaseConn initialized

This creates import loops. It's always better to initialize them within
the class' __init__
This commit is contained in:
angelblue05 2016-11-05 16:15:07 -05:00
parent 16df4d6404
commit 82c31e0672

View file

@ -8,8 +8,8 @@ import hashlib
import xbmc
import downloadutils
import database
from utils import window, settings
from database import DatabaseConn
from contextlib import closing
#################################################################################################
@ -27,7 +27,7 @@ class Read_EmbyServer():
def __init__(self):
self.doUtils = downloadutils.DownloadUtils().downloadUrl
self.database = database.DatabaseConn
self.userId = window('emby_currUser')
self.server = window('emby_server%s' % self.userId)
@ -107,7 +107,7 @@ class Read_EmbyServer():
viewId = view['Id']
# Compare to view table in emby database
with DatabaseConn('emby') as conn:
with self.database('emby') as conn:
with closing(conn.cursor()) as cursor:
query = ' '.join((