Nosql
This commit is contained in:
1 parent
a13e0a75e8
commit
4b356aba3e
2 files changed
+10
-11
No files matched your search
@@ -72,11 +72,10 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
|
|||||||
|
|
||||||
db = get_db()
|
db = get_db()
|
||||||
|
|
||||||
movies = db.get_many('movie_status', 'active')
|
medias = [x['_id'] for x in db.run('media', 'with_status', 'active', with_doc = False)]
|
||||||
|
random.shuffle(medias)
|
||||||
|
|
||||||
#TODO: random.shuffle(movies_raw)
|
total = len(medias)
|
||||||
|
|
||||||
total = db.count(db.get_many, 'movie_status', 'active')
|
|
||||||
self.in_progress = {
|
self.in_progress = {
|
||||||
'total': total,
|
'total': total,
|
||||||
'to_go': total,
|
'to_go': total,
|
||||||
@@ -85,17 +84,17 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
|
|||||||
try:
|
try:
|
||||||
search_protocols = fireEvent('searcher.protocols', single = True)
|
search_protocols = fireEvent('searcher.protocols', single = True)
|
||||||
|
|
||||||
for movie in movies:
|
for media_id in medias:
|
||||||
|
|
||||||
movie_dict = db.run('media', 'to_dict', movie['_id'])
|
media = db.run('media', 'to_dict', media_id)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
self.single(movie_dict, search_protocols)
|
self.single(media, search_protocols)
|
||||||
except IndexError:
|
except IndexError:
|
||||||
log.error('Forcing library update for %s, if you see this often, please report: %s', (movie['identifier'], traceback.format_exc()))
|
log.error('Forcing library update for %s, if you see this often, please report: %s', (media['identifier'], traceback.format_exc()))
|
||||||
fireEvent('movie.update_info', movie['_id'])
|
fireEvent('movie.update_info', media_id)
|
||||||
except:
|
except:
|
||||||
log.error('Search failed for %s: %s', (movie['identifier'], traceback.format_exc()))
|
log.error('Search failed for %s: %s', (media['identifier'], traceback.format_exc()))
|
||||||
|
|
||||||
self.in_progress['to_go'] -= 1
|
self.in_progress['to_go'] -= 1
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class Dashboard(Plugin):
|
|||||||
limit = tryInt(splt[0])
|
limit = tryInt(splt[0])
|
||||||
|
|
||||||
# Get all active medias
|
# Get all active medias
|
||||||
active_ids = [x['_id'] for x in db.get_many('media_status', 'active')]
|
active_ids = [x['_id'] for x in db.run('media', 'with_status', 'active', with_doc = False)]
|
||||||
|
|
||||||
medias = []
|
medias = []
|
||||||
if len(active_ids) > 0:
|
if len(active_ids) > 0:
|
||||||
|
|||||||
Reference in new issue
Block a user