Move status_get outside index
This commit is contained in:
@@ -45,7 +45,7 @@ class Dashboard(Plugin):
|
||||
limit = tryInt(splt[0])
|
||||
|
||||
# Get all active medias
|
||||
active_ids = [x['_id'] for x in db.run('media', 'with_status', 'active', with_doc = False)]
|
||||
active_ids = [x['_id'] for x in fireEvent('media.with_status', 'active', with_doc = False, single = True)]
|
||||
|
||||
medias = []
|
||||
now_year = date.today().year
|
||||
|
||||
@@ -2,7 +2,7 @@ import traceback
|
||||
|
||||
from couchpotato import get_db, tryInt
|
||||
from couchpotato.api import addApiView
|
||||
from couchpotato.core.event import addEvent
|
||||
from couchpotato.core.event import addEvent, fireEvent
|
||||
from couchpotato.core.helpers.encoding import toUnicode
|
||||
from couchpotato.core.logger import CPLog
|
||||
from couchpotato.core.plugins.base import Plugin
|
||||
@@ -41,7 +41,7 @@ class ProfilePlugin(Plugin):
|
||||
# Get all active movies without profile
|
||||
try:
|
||||
db = get_db()
|
||||
medias = db.run('media', 'with_status', ['active'])
|
||||
medias = fireEvent('media.with_status', 'active', single = True)
|
||||
|
||||
profile_ids = [x.get('_id') for x in self.all()]
|
||||
default_id = profile_ids[0]
|
||||
|
||||
@@ -67,7 +67,7 @@ class Release(Plugin):
|
||||
db = get_db()
|
||||
|
||||
# get movies last_edit more than a week ago
|
||||
medias = db.run('media', 'with_status', ['done'])
|
||||
medias = fireEvent('media.with_status', 'done', single = True)
|
||||
|
||||
for media in medias:
|
||||
if media.get('last_edit', 0) > (now - week):
|
||||
|
||||
Reference in New Issue
Block a user