database manage init
This commit is contained in:
@@ -12,7 +12,9 @@ log = CPLog(__name__)
|
||||
|
||||
class ProfilePlugin(Plugin):
|
||||
|
||||
to_dict = {'types': {}}
|
||||
_database = {
|
||||
'profile': ProfileIndex
|
||||
}
|
||||
|
||||
def __init__(self):
|
||||
addEvent('profile.all', self.all)
|
||||
@@ -29,21 +31,9 @@ class ProfilePlugin(Plugin):
|
||||
}"""}
|
||||
})
|
||||
|
||||
addEvent('database.setup', self.databaseSetup)
|
||||
|
||||
addEvent('app.initialize', self.fill, priority = 90)
|
||||
addEvent('app.load', self.forceDefaults)
|
||||
|
||||
def databaseSetup(self):
|
||||
|
||||
db = get_db()
|
||||
|
||||
try:
|
||||
db.add_index(ProfileIndex(db.path, 'profile'))
|
||||
except:
|
||||
log.debug('Index already exists')
|
||||
db.edit_index(ProfileIndex(db.path, 'profile'))
|
||||
|
||||
def forceDefaults(self):
|
||||
|
||||
# Get all active movies without profile
|
||||
|
||||
Reference in New Issue
Block a user