2013-02-13 18:28:56 -08:00
|
|
|
|
define(['app'], function () {
|
|
|
|
|
NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
|
|
|
|
|
2013-03-07 19:11:42 -08:00
|
|
|
|
mutators: {
|
2013-03-29 16:28:58 -07:00
|
|
|
|
allowed: function () {
|
2013-03-07 19:11:42 -08:00
|
|
|
|
return _.where(this.get('qualities'), { allowed: true });
|
|
|
|
|
},
|
2013-02-13 18:28:56 -08:00
|
|
|
|
|
2013-03-29 16:28:58 -07:00
|
|
|
|
cutoffName: function () {
|
2013-03-07 19:11:42 -08:00
|
|
|
|
return _.findWhere(this.get('qualities'), { id: this.get('cutoff') }).name;
|
2013-01-26 19:04:15 -08:00
|
|
|
|
}
|
2013-02-13 18:28:56 -08:00
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
defaults: {
|
2013-03-29 16:28:58 -07:00
|
|
|
|
id : null,
|
|
|
|
|
name : '',
|
2013-03-13 17:26:30 -07:00
|
|
|
|
//'qualities.allowed': false,
|
2013-03-07 19:11:42 -08:00
|
|
|
|
cutoff: null
|
2013-02-13 18:28:56 -08:00
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2013-01-26 19:04:15 -08:00
|
|
|
|
|