Fill in profiles & qualities when they are empty. fix #3396

This commit is contained in:
Ruud committed 2014-06-11 09:31:29 +02:00
1 parent 17ba9ee96b
commit 7788669de1
2 files changed
+36 -18

No files matched your search

+10 -1
View File
@@ -38,9 +38,18 @@ class ProfilePlugin(Plugin):
def forceDefaults(self):
db = get_db()
# Fill qualities and profiles if they are empty somehow..
if db.count(db.all, 'profile') == 0:
if db.count(db.all, 'quality') == 0:
fireEvent('quality.fill', single = True)
self.fill()
# Get all active movies without profile
try:
db = get_db()
medias = fireEvent('media.with_status', 'active', single = True)
profile_ids = [x.get('_id') for x in self.all()]