Don't add movies without imdb id

This commit is contained in:
Ruud
2012-06-13 15:33:19 +02:00
parent ea6b274f02
commit 057b941c86
2 changed files with 7 additions and 3 deletions
+5 -1
View File
@@ -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'
})
);
},