mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-18 21:35:51 -04:00
removed backbone from VS solution,
renamed NzbDrone.Backbone to UI
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
define(['app', 'Quality/QualitySizeModel'], function () {
|
||||
NzbDrone.Quality.QualitySizeCollection = Backbone.Collection.extend({
|
||||
model: NzbDrone.Quality.QualitySizeModel,
|
||||
url: NzbDrone.Constants.ApiRoot + '/qualitysizes'
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
define(['app'], function () {
|
||||
NzbDrone.Quality.QualitySizeModel = Backbone.Model.extend({
|
||||
|
||||
initialize: function () {
|
||||
this.validators = {};
|
||||
},
|
||||
|
||||
mutators: {
|
||||
thirtyMinuteSize: function() {
|
||||
return this.get('maxSize') * 30;
|
||||
},
|
||||
sixtyMinuteSize: function(){
|
||||
return this.get('maxSize') * 60;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,13 @@
|
||||
define(['app', 'Quality/QualityProfileModel'], function () {
|
||||
|
||||
var qualityProfileCollection = Backbone.Collection.extend({
|
||||
model:NzbDrone.Quality.QualityProfileModel,
|
||||
url:NzbDrone.Constants.ApiRoot + '/qualityprofiles'
|
||||
});
|
||||
|
||||
var profiles = new qualityProfileCollection();
|
||||
|
||||
profiles.fetch();
|
||||
|
||||
return profiles;
|
||||
});
|
||||
@@ -0,0 +1,22 @@
|
||||
define(['app'], function () {
|
||||
NzbDrone.Quality.QualityProfileModel = Backbone.Model.extend({
|
||||
|
||||
mutators: {
|
||||
allowed: function() {
|
||||
return _.where(this.get('qualities'), { allowed: true });
|
||||
},
|
||||
|
||||
cutoffName: function() {
|
||||
return _.findWhere(this.get('qualities'), { id: this.get('cutoff') }).name;
|
||||
}
|
||||
},
|
||||
|
||||
defaults: {
|
||||
id: null,
|
||||
name: '',
|
||||
//'qualities.allowed': false,
|
||||
cutoff: null
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user