Nonblocking update listener

This commit is contained in:
Ruud
2012-05-26 22:55:11 +02:00
parent 98c8a47dd0
commit fcd13fcb85
10 changed files with 170 additions and 48 deletions
-3
View File
@@ -127,9 +127,6 @@ class LibraryPlugin(Plugin):
library_dict = library.to_dict(self.default_dict)
fireEvent('notify.frontend', type = 'library.update.%s' % identifier, data = library_dict)
#db.close()
return library_dict
def updateReleaseDate(self, identifier):
+1
View File
@@ -239,6 +239,7 @@ class MoviePlugin(Plugin):
db = get_session()
for id in getParam('id').split(','):
fireEvent('notify.frontend', type = 'movie.busy.%s' % id, data = True)
movie = db.query(Movie).filter_by(id = id).first()
# Get current selected title
@@ -17,14 +17,16 @@ var Movie = new Class({
self.parent(self, options);
App.addEvent('movie.update.'+data.id, self.update.bind(self));
App.addEvent('searcher.started.'+data.id, self.searching.bind(self));
App.addEvent('searcher.ended.'+data.id, self.searching.bind(self));
App.addEvent('movie.busy.'+data.id, function(notification){
if(notification.data)
self.busy(true)
});
},
searching: function(notification){
busy: function(set_busy){
var self = this;
if(notification && notification.type.indexOf('ended') > -1){
if(!set_busy){
if(self.spinner){
self.mask.fade('out');
setTimeout(function(){
@@ -72,8 +74,11 @@ var Movie = new Class({
self.data = notification.data;
self.container.destroy();
self.profile = Quality.getProfile(self.data.profile_id) || {};
self.create();
self.busy(false);
},
create: function(){