mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 21:43:33 -07:00
last used quality profile is now used as default
This commit is contained in:
parent
465dc725c8
commit
e4e6bcae1d
16 changed files with 70 additions and 66 deletions
|
@ -1,13 +1,13 @@
|
|||
"use strict";
|
||||
define([
|
||||
'app',
|
||||
'AddSeries/RootFolders/RootFolderCollection',
|
||||
'Quality/QualityProfileCollection',
|
||||
'AddSeries/RootFolders/RootFolderCollection',
|
||||
'AddSeries/RootFolders/RootFolderView',
|
||||
'AddSeries/AddSeriesView',
|
||||
'AddSeries/Existing/ImportSeriesView'
|
||||
],
|
||||
function (app, rootFolderCollection, qualityProfileCollection) {
|
||||
function (app, qualityProfileCollection, rootFolderCollection) {
|
||||
NzbDrone.AddSeries.AddSeriesLayout = Backbone.Marionette.Layout.extend({
|
||||
template: 'AddSeries/addSeriesLayoutTemplate',
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
'use strict';
|
||||
define([
|
||||
'app', 'AddSeries/RootFolders/RootFolderCollection',
|
||||
'Quality/QualityProfileCollection',
|
||||
'AddSeries/Existing/UnmappedFolderModel',
|
||||
'AddSeries/Collection',
|
||||
'AddSeries/SearchResultView',
|
||||
|
@ -22,7 +21,6 @@ define([
|
|||
ui: {
|
||||
searchButton: '.x-btn-search',
|
||||
searchText : '.x-txt-search',
|
||||
profileList : '.x-lst-quality-profile',
|
||||
searchBar : '.x-search-bar',
|
||||
loadMore : '.x-load-more'
|
||||
},
|
||||
|
@ -99,7 +97,6 @@ define([
|
|||
|
||||
itemViewOptions: function () {
|
||||
return {
|
||||
qualityProfile: this.ui.profileList,
|
||||
rootFolder : this.model.get('rootFolder'),
|
||||
folder : this.model.get('folder').path,
|
||||
isExisting : true
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
'use strict';
|
||||
define(['app', 'Quality/QualityProfileCollection'], function (app, qualityProfiles) {
|
||||
define(['app'], function () {
|
||||
|
||||
|
||||
NzbDrone.AddSeries.Existing.UnmappedFolderModel = Backbone.Model.extend({
|
||||
|
||||
defaults: {
|
||||
quality: qualityProfiles
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
NzbDrone.AddSeries.Existing.UnmappedFolderCollection = Backbone.Collection.extend({
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
<select class="span6 x-root-folder">
|
||||
{{debug}}
|
||||
{{#each this}}
|
||||
<option value="{{id}}">{{path}}</option>
|
||||
{{/each}}
|
||||
|
|
|
@ -19,13 +19,11 @@
|
|||
<icon class="icon-plus"></icon>
|
||||
</div>
|
||||
{{#unless isExisting}}
|
||||
{{rootFolderSelection}}
|
||||
{{rootFolderSelection}}
|
||||
{{/unless}}
|
||||
<select class="span2 x-quality-profile pull-right">
|
||||
{{#each qualityProfiles.models}}
|
||||
<option value="{{id}}">{{attributes.name}}</option>
|
||||
{{/each}}
|
||||
</select>
|
||||
<div class='pull-right'>
|
||||
{{qualityProfileSelection}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,10 @@
|
|||
'use strict';
|
||||
define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTemplateHelper'], function () {
|
||||
define(['app',
|
||||
'Quality/QualityProfileCollection',
|
||||
'Config',
|
||||
'Series/SeriesCollection',
|
||||
'AddSeries/RootFolders/RootFolderTemplateHelper',
|
||||
'Quality/QualityProfileTemplateHelper'], function (app, qualityProfiles) {
|
||||
|
||||
NzbDrone.AddSeries.SearchResultView = Backbone.Marionette.ItemView.extend({
|
||||
|
||||
|
@ -13,7 +18,8 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
|||
},
|
||||
|
||||
events: {
|
||||
'click .x-add': 'addSeries'
|
||||
'click .x-add' : 'addSeries',
|
||||
'change .x-quality-profile': '_qualityProfileChanged'
|
||||
},
|
||||
|
||||
initialize: function () {
|
||||
|
@ -24,12 +30,33 @@ define(['app', 'Series/SeriesCollection', 'AddSeries/RootFolders/RootFolderTempl
|
|||
|
||||
this.model.set('isExisting', this.options.isExisting);
|
||||
this.model.set('path', this.options.folder);
|
||||
|
||||
NzbDrone.vent.on(NzbDrone.Config.Events.ConfigUpdatedEvent, this._onConfigUpdated, this);
|
||||
},
|
||||
|
||||
|
||||
_onConfigUpdated: function (options) {
|
||||
|
||||
if (options.key === NzbDrone.Config.Keys.DefaultQualityProfileId) {
|
||||
this.$('.x-quality-profile').val(options.value);
|
||||
}
|
||||
},
|
||||
|
||||
_qualityProfileChanged: function () {
|
||||
NzbDrone.Config.SetValue(NzbDrone.Config.Keys.DefaultQualityProfileId, this.ui.qualityProfile.val());
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.listenTo(this.model, 'change', this.render);
|
||||
|
||||
var defaultQuality = NzbDrone.Config.GetValue(NzbDrone.Config.Keys.DefaultQualityProfileId);
|
||||
|
||||
if (qualityProfiles.get(defaultQuality)) {
|
||||
this.ui.qualityProfile.val(defaultQuality);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
addSeries: function () {
|
||||
var icon = this.ui.addButton.find('icon');
|
||||
icon.removeClass('icon-plus').addClass('icon-spin icon-spinner disabled');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue