Browse Source

Don't add movies without imdb id

pull/460/merge
Ruud 13 years ago
parent
commit
057b941c86
  1. 6
      couchpotato/core/plugins/movie/main.py
  2. 4
      couchpotato/core/plugins/movie/static/search.js

6
couchpotato/core/plugins/movie/main.py

@ -280,6 +280,10 @@ class MoviePlugin(Plugin):
def add(self, params = {}, force_readd = True, search_after = True): 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) library = fireEvent('library.add', single = True, attrs = params, update_after = False)
# Status # Status
@ -352,7 +356,7 @@ class MoviePlugin(Plugin):
return jsonified({ return jsonified({
'success': True, 'success': True,
'added': True, 'added': True if movie_dict else False,
'movie': movie_dict, 'movie': movie_dict,
}) })

4
couchpotato/core/plugins/movie/static/search.js

@ -301,11 +301,11 @@ Block.Search.Item = new Class({
'title': self.title_select.get('value'), 'title': self.title_select.get('value'),
'profile_id': self.profile_select.get('value') 'profile_id': self.profile_select.get('value')
}, },
'onComplete': function(){ 'onComplete': function(json){
self.options.empty(); self.options.empty();
self.options.adopt( self.options.adopt(
new Element('div.message', { new Element('div.message', {
'text': 'Movie succesfully added.' 'text': json.added ? 'Movie succesfully added.' : 'Movie didn\'t add properly. Check logs'
}) })
); );
}, },

Loading…
Cancel
Save