From 5489215ffe0eeac5bc690b63f3e79b16876cb3a5 Mon Sep 17 00:00:00 2001 From: Ruud Date: Wed, 7 Sep 2011 18:27:05 +0200 Subject: [PATCH] Return active profiles --- couchpotato/core/plugins/movie/static/search.js | 2 +- couchpotato/core/plugins/quality/static/quality.js | 7 +++++++ couchpotato/static/scripts/page/wanted.js | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/couchpotato/core/plugins/movie/static/search.js b/couchpotato/core/plugins/movie/static/search.js index 1ba8e8c..5e66d30 100644 --- a/couchpotato/core/plugins/movie/static/search.js +++ b/couchpotato/core/plugins/movie/static/search.js @@ -303,7 +303,7 @@ Block.Search.Item = new Class({ }).inject(self.title_select) }) - Object.each(Quality.profiles, function(profile){ + Object.each(Quality.getActiveProfiles(), function(profile){ new Element('option', { 'value': profile.id ? profile.id : profile.data.id, 'text': profile.label ? profile.label : profile.data.label diff --git a/couchpotato/core/plugins/quality/static/quality.js b/couchpotato/core/plugins/quality/static/quality.js index a20eeef..39ed239 100644 --- a/couchpotato/core/plugins/quality/static/quality.js +++ b/couchpotato/core/plugins/quality/static/quality.js @@ -19,6 +19,13 @@ var QualityBase = new Class({ return this.profiles[id] }, + // Hide items when getting profiles + getActiveProfiles: function(){ + return Object.filter(this.profiles, function(profile){ + return !profile.data.hide + }); + }, + getQuality: function(id){ return this.qualities.filter(function(q){ return q.id == id; diff --git a/couchpotato/static/scripts/page/wanted.js b/couchpotato/static/scripts/page/wanted.js index 5ac57bd..da98232 100644 --- a/couchpotato/static/scripts/page/wanted.js +++ b/couchpotato/static/scripts/page/wanted.js @@ -78,7 +78,7 @@ MovieActions.Wanted = { }).inject(self.title_select); }); - Object.each(Quality.profiles, function(profile){ + Object.each(Quality.getActiveProfiles(), function(profile){ new Element('option', { 'value': profile.id ? profile.id : profile.data.id, 'text': profile.label ? profile.label : profile.data.label