Don't add movies without imdb id
This commit is contained in:
@@ -280,6 +280,10 @@ class MoviePlugin(Plugin):
|
||||
|
||||
def add(self, params = {}, force_readd = True, search_after = True):
|
||||
|
||||
if not params.get('identifier'):
|
||||
log.error('Can\'t add movie without imdb identifier.')
|
||||
return False
|
||||
|
||||
library = fireEvent('library.add', single = True, attrs = params, update_after = False)
|
||||
|
||||
# Status
|
||||
@@ -352,7 +356,7 @@ class MoviePlugin(Plugin):
|
||||
|
||||
return jsonified({
|
||||
'success': True,
|
||||
'added': True,
|
||||
'added': True if movie_dict else False,
|
||||
'movie': movie_dict,
|
||||
})
|
||||
|
||||
|
||||
@@ -301,11 +301,11 @@ Block.Search.Item = new Class({
|
||||
'title': self.title_select.get('value'),
|
||||
'profile_id': self.profile_select.get('value')
|
||||
},
|
||||
'onComplete': function(){
|
||||
'onComplete': function(json){
|
||||
self.options.empty();
|
||||
self.options.adopt(
|
||||
new Element('div.message', {
|
||||
'text': 'Movie succesfully added.'
|
||||
'text': json.added ? 'Movie succesfully added.' : 'Movie didn\'t add properly. Check logs'
|
||||
})
|
||||
);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user