Browse Source

Don't refresh suggestion on add from chart listings

pull/5180/head
Ruud 10 years ago
parent
commit
0d9eec2591
  1. 4
      couchpotato/core/media/movie/_base/static/movie.actions.js
  2. 17
      couchpotato/core/media/movie/charts/main.py
  3. 6
      couchpotato/static/scripts/combined.plugins.min.js

4
couchpotato/core/media/movie/_base/static/movie.actions.js

@ -699,7 +699,7 @@ MA.Add = new Class({
var self = this;
var m = new BlockSearchMovieItem(self.movie.data.info, {
'onAdded': function(){
'onAdded': self.movie.data.status == 'suggested' ? function(){
Api.request('suggestion.ignore', {
'data': {
@ -709,6 +709,8 @@ MA.Add = new Class({
'onComplete': self.refresh.bind(self)
});
} : function(){
self.movie.destroy();
}
});
m.showOptions();

17
couchpotato/core/media/movie/charts/main.py

@ -1,5 +1,6 @@
import time
from couchpotato import Env
from CodernityDB.database import RecordNotFound
from couchpotato import Env, get_db
from couchpotato.core.helpers.variable import getTitle, splitString
from couchpotato.core.logger import CPLog
@ -22,6 +23,8 @@ class Charts(Plugin):
def automationView(self, force_update = False, **kwargs):
db = get_db()
if force_update:
charts = self.updateViewCache()
else:
@ -40,13 +43,23 @@ class Charts(Plugin):
if identifier in ignored:
continue
try:
try:
in_library = db.get('media', 'imdb-%s' % identifier)
if in_library:
continue
except RecordNotFound:
pass
except:
pass
# Cache poster
poster = media.get('images', {}).get('poster', [])
cached_poster = fireEvent('file.download', url = poster[0], single = True) if len(poster) > 0 else False
files = {'image_poster': [cached_poster] } if cached_poster else {}
medias.append({
'status': 'suggested',
'status': 'chart',
'title': getTitle(media),
'type': 'movie',
'info': media,

6
couchpotato/static/scripts/combined.plugins.min.js

@ -461,7 +461,7 @@ var MovieList = new Class({
click: self.loadMore.bind(self)
}
}) : null);
self.changeView((self.options.force_view ? self.options.view : self.getSavedView() || self.options.view) || "thumb");
self.changeView(self.getSavedView() || self.options.view || "thumb");
if (self.options.navigation) self.createNavigation();
if (self.options.api_call) self.getMovies();
App.on("movie.added", self.movieAdded.bind(self));
@ -1508,7 +1508,7 @@ MA.Add = new Class({
getDetails: function() {
var self = this;
var m = new BlockSearchMovieItem(self.movie.data.info, {
onAdded: function() {
onAdded: self.movie.data.status == "suggested" ? function() {
Api.request("suggestion.ignore", {
data: {
imdb: self.movie.data.info.imdb,
@ -1516,6 +1516,8 @@ MA.Add = new Class({
},
onComplete: self.refresh.bind(self)
});
} : function() {
self.movie.destroy();
}
});
m.showOptions();

Loading…
Cancel
Save