Ignore deleted media documents
This commit is contained in:
@@ -46,7 +46,8 @@ class Automation(Plugin):
|
||||
break
|
||||
|
||||
movie_dict = fireEvent('media.get', movie_id, single = True)
|
||||
fireEvent('movie.searcher.single', movie_dict)
|
||||
if movie_dict:
|
||||
fireEvent('movie.searcher.single', movie_dict)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import random as rndm
|
||||
import time
|
||||
from CodernityDB.database import RecordDeleted
|
||||
|
||||
from couchpotato import get_db
|
||||
from couchpotato.api import addApiView
|
||||
@@ -58,7 +59,11 @@ class Dashboard(Plugin):
|
||||
rndm.shuffle(active_ids)
|
||||
|
||||
for media_id in active_ids:
|
||||
media = db.get('id', media_id)
|
||||
try:
|
||||
media = db.get('id', media_id)
|
||||
except RecordDeleted:
|
||||
log.debug('Record already deleted: %s', media_id)
|
||||
continue
|
||||
|
||||
pp = profile_pre.get(media.get('profile_id'))
|
||||
if not pp: continue
|
||||
|
||||
@@ -234,7 +234,8 @@ class Manage(Plugin):
|
||||
total = self.in_progress[folder]['total']
|
||||
movie_dict = fireEvent('media.get', identifier, single = True)
|
||||
|
||||
fireEvent('notify.frontend', type = 'movie.added', data = movie_dict, message = None if total > 5 else 'Added "%s" to manage.' % getTitle(movie_dict))
|
||||
if movie_dict:
|
||||
fireEvent('notify.frontend', type = 'movie.added', data = movie_dict, message = None if total > 5 else 'Added "%s" to manage.' % getTitle(movie_dict))
|
||||
|
||||
return afterUpdate
|
||||
|
||||
|
||||
Reference in New Issue
Block a user