mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Media Management settings are alive
This commit is contained in:
parent
943a05bc09
commit
3f6a6d53d5
29 changed files with 346 additions and 218 deletions
13
UI/Settings/MediaManagement/FileManagement/View.js
Normal file
13
UI/Settings/MediaManagement/FileManagement/View.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/FileManagement/ViewTemplate'
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
23
UI/Settings/MediaManagement/FileManagement/ViewTemplate.html
Normal file
23
UI/Settings/MediaManagement/FileManagement/ViewTemplate.html
Normal file
|
@ -0,0 +1,23 @@
|
|||
<fieldset>
|
||||
<legend>File Management</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Ignore Deleted Episodes</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="autoIgnorePreviouslyDownloadedEpisodes"/>
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Episodes deleted from disk are automatically ignored in NzbDrone"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
31
UI/Settings/MediaManagement/Layout.js
Normal file
31
UI/Settings/MediaManagement/Layout.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
"use strict";
|
||||
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Settings/MediaManagement/Naming/View',
|
||||
'Settings/MediaManagement/Sorting/View',
|
||||
'Settings/MediaManagement/FileManagement/View'
|
||||
], function (Marionette, NamingView, SortingView, FileManagementView) {
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Settings/MediaManagement/LayoutTemplate',
|
||||
|
||||
regions: {
|
||||
episodeNaming : '#episode-naming',
|
||||
sorting : '#sorting',
|
||||
fileManagement : '#file-management'
|
||||
},
|
||||
|
||||
initialize: function (options) {
|
||||
this.settings = options.settings;
|
||||
this.namingSettings = options.namingSettings;
|
||||
},
|
||||
|
||||
onRender: function () {
|
||||
this.episodeNaming.show(new NamingView({ model: this.namingSettings }));
|
||||
this.sorting.show(new SortingView({ model: this.settings }));
|
||||
this.fileManagement.show(new FileManagementView({ model: this.settings }));
|
||||
}
|
||||
});
|
||||
});
|
||||
|
5
UI/Settings/MediaManagement/LayoutTemplate.html
Normal file
5
UI/Settings/MediaManagement/LayoutTemplate.html
Normal file
|
@ -0,0 +1,5 @@
|
|||
<div class="form-horizontal">
|
||||
<div id="episode-naming"></div>
|
||||
<div id="sorting"></div>
|
||||
<div id="file-management"></div>
|
||||
</div>
|
12
UI/Settings/MediaManagement/Naming/Model.js
Normal file
12
UI/Settings/MediaManagement/Naming/Model.js
Normal file
|
@ -0,0 +1,12 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'Settings/SettingsModelBase'
|
||||
], function (ModelBase) {
|
||||
return ModelBase.extend({
|
||||
url : window.ApiRoot + '/config/naming',
|
||||
successMessage: 'MediaManagement settings saved',
|
||||
errorMessage : 'Couldn\'t save naming settings'
|
||||
});
|
||||
|
||||
});
|
43
UI/Settings/MediaManagement/Naming/View.js
Normal file
43
UI/Settings/MediaManagement/Naming/View.js
Normal file
|
@ -0,0 +1,43 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/Naming/ViewTemplate',
|
||||
|
||||
ui: {
|
||||
namingOptions : '.x-naming-options',
|
||||
renameEpisodesCheckbox : '.x-rename-episodes'
|
||||
},
|
||||
|
||||
events: {
|
||||
'change .x-rename-episodes': '_toggleNamingOptions'
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
var renameEpisodes = this.model.get('renameEpisodes');
|
||||
this._setNamingOptionsVisibility(renameEpisodes);
|
||||
},
|
||||
|
||||
_toggleNamingOptions: function() {
|
||||
var checked = this.ui.renameEpisodesCheckbox.prop('checked');
|
||||
this._setNamingOptionsVisibility(checked);
|
||||
},
|
||||
|
||||
_setNamingOptionsVisibility: function (showNamingOptions) {
|
||||
|
||||
if (showNamingOptions) {
|
||||
this.ui.namingOptions.show();
|
||||
}
|
||||
|
||||
else {
|
||||
this.ui.namingOptions.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
132
UI/Settings/MediaManagement/Naming/ViewTemplate.html
Normal file
132
UI/Settings/MediaManagement/Naming/ViewTemplate.html
Normal file
|
@ -0,0 +1,132 @@
|
|||
<fieldset>
|
||||
<legend>Episode Naming</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Rename Episodes</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="renameEpisodes" class="x-rename-episodes"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-form-danger" title="NzbDrone will use the existing file name if set to no"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x-naming-options">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Include Series Title</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="includeSeriesTitle"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Include Episode Title</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="includeEpisodeTitle"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Include Quality</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="includeQuality"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Replace Spaces</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="replaceSpaces"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Separator</label>
|
||||
|
||||
<div class="controls">
|
||||
<select class="inputClass x-backlog-setting" name="separator">
|
||||
<option value=" - ">Dash</option>
|
||||
<option value=" ">Space</option>
|
||||
<option value=".">Period</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Numbering Style</label>
|
||||
|
||||
<div class="controls">
|
||||
<select class="inputClass x-backlog-setting" name="numberStyle">
|
||||
<option value="0">1x05</option>
|
||||
<option value="1">01x05</option>
|
||||
<option value="2">S01E05</option>
|
||||
<option value="3">s01e05</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Multi-Episode Style</label>
|
||||
|
||||
<div class="controls">
|
||||
<select class="inputClass x-backlog-setting" name="multiEpisodeStyle">
|
||||
<option value="0">Extend</option>
|
||||
<option value="1">Duplicate</option>
|
||||
<option value="2">Repeat</option>
|
||||
<option value="3">Scene</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
13
UI/Settings/MediaManagement/Sorting/View.js
Normal file
13
UI/Settings/MediaManagement/Sorting/View.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/MediaManagement/Sorting/ViewTemplate'
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
32
UI/Settings/MediaManagement/Sorting/ViewTemplate.html
Normal file
32
UI/Settings/MediaManagement/Sorting/ViewTemplate.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<fieldset>
|
||||
<legend>Sorting</legend>
|
||||
|
||||
<!--TODO: Remove this and move it to Add Series-->
|
||||
<div class="control-group">
|
||||
<label class="control-label">Use Season Folder</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="useSeasonFolder"/>
|
||||
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Season Folder Format</label>
|
||||
|
||||
<div class="controls">
|
||||
<input type="text" placeholder="Season %s" name="seasonFolderFormat"/>
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="How should season folders be named? (Use %0s to pad to two digits, %sn for Series Name)"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
Loading…
Add table
Add a link
Reference in a new issue