|
|
@ -49,17 +49,19 @@ class LibraryPlugin(Plugin): |
|
|
|
library = db.query(Library).filter_by(identifier = identifier).first() |
|
|
|
done_status = fireEvent('status.get', 'done', single = True) |
|
|
|
|
|
|
|
library_dict = library.to_dict({'titles': {}, 'files':{}}) |
|
|
|
library_dict = library.to_dict({'titles': {}, 'files':{}, 'info':{}}) |
|
|
|
do_update = True |
|
|
|
|
|
|
|
if library.status_id == done_status.get('id') and not force: |
|
|
|
return library_dict |
|
|
|
|
|
|
|
do_update = False |
|
|
|
else: |
|
|
|
info = fireEvent('provider.movie.info', merge = True, identifier = identifier) |
|
|
|
if not info or len(info) == 0: |
|
|
|
log.error('Could not update, no movie info to work with: %s' % identifier) |
|
|
|
return library_dict |
|
|
|
do_update = False |
|
|
|
|
|
|
|
# Main info |
|
|
|
if do_update: |
|
|
|
library.plot = info.get('plot', '') |
|
|
|
library.tagline = info.get('tagline', '') |
|
|
|
library.year = info.get('year', 0) |
|
|
@ -98,8 +100,8 @@ class LibraryPlugin(Plugin): |
|
|
|
except: |
|
|
|
log.debug('Failed to attach to library: %s' % traceback.format_exc()) |
|
|
|
|
|
|
|
library_dict = library.to_dict({'titles': {}, 'files':{}}) |
|
|
|
library_dict = library.to_dict({'titles': {}, 'files':{}, 'info':{}}) |
|
|
|
|
|
|
|
fireEvent('library.update', data = library_dict) |
|
|
|
fireEvent('library.update_finish', data = library_dict) |
|
|
|
|
|
|
|
return library_dict |
|
|
|