mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-20 05:23:31 -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
|
@ -2,5 +2,5 @@
|
|||
{{#each this}}
|
||||
<option value="{{id}}">{{path}}</option>
|
||||
{{/each}}
|
||||
<option value="addNew">Add a diffrent path</option>
|
||||
<option value="addNew">Add a different path</option>
|
||||
</select>
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
.control-group {
|
||||
.controls {
|
||||
i.danger {
|
||||
color : #b94a48;
|
||||
}
|
||||
i.warning {
|
||||
color : #f89406;
|
||||
}
|
||||
i {
|
||||
font-size : 16px;
|
||||
color : #595959;
|
||||
|
@ -19,8 +13,6 @@
|
|||
margin-bottom : 0px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.help-inline-checkbox {
|
||||
padding-left : 5px;
|
||||
display : inline-block;
|
||||
|
|
|
@ -57,3 +57,17 @@
|
|||
.icon-nd-add:before {
|
||||
.icon(@plus);
|
||||
}
|
||||
|
||||
.icon-form-info:before {
|
||||
.icon(@question-sign);
|
||||
}
|
||||
|
||||
.icon-form-warning:before {
|
||||
.icon(@warning-sign);
|
||||
color : #f89406;
|
||||
}
|
||||
|
||||
.icon-form-danger:before {
|
||||
.icon(@exclamation-sign);
|
||||
color : #b94a48;
|
||||
}
|
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>
|
|
@ -5,7 +5,7 @@ define(
|
|||
], function (ModelBase) {
|
||||
return ModelBase.extend({
|
||||
url : window.ApiRoot + '/config/naming',
|
||||
successMessage: 'Naming settings saved',
|
||||
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);
|
||||
});
|
|
@ -1,28 +1,28 @@
|
|||
<div class="form-horizontal">
|
||||
<fieldset>
|
||||
<legend>Episode Naming</legend>
|
||||
<fieldset>
|
||||
<legend>Episode Naming</legend>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Use Scene Name</label>
|
||||
<div class="control-group">
|
||||
<label class="control-label">Rename Episodes</label>
|
||||
|
||||
<div class="controls">
|
||||
<label class="checkbox toggle well">
|
||||
<input type="checkbox" name="useSceneName"/>
|
||||
<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>
|
||||
<p>
|
||||
<span>Yes</span>
|
||||
<span>No</span>
|
||||
</p>
|
||||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Use the scene name, ignoring all other naming settings"/>
|
||||
<i class="icon-form-danger" title="NzbDrone will use the existing file name if set to no"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="x-naming-options">
|
||||
<div class="control-group">
|
||||
<label class="control-label">Include Series Title</label>
|
||||
|
||||
|
@ -37,10 +37,6 @@
|
|||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Should filenames contain the series name when renamed?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -58,10 +54,6 @@
|
|||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Should filenames contain the episode name when renamed?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -79,10 +71,6 @@
|
|||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Should filenames have the include the quality?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -100,21 +88,6 @@
|
|||
|
||||
<div class="btn btn-primary slide-button"/>
|
||||
</label>
|
||||
|
||||
<span class="help-inline-checkbox">
|
||||
<i class="icon-question-sign" title="Do you want to replace spaces in the filename with periods?"/>
|
||||
</span>
|
||||
</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>
|
||||
|
||||
|
@ -127,9 +100,6 @@
|
|||
<option value=" ">Space</option>
|
||||
<option value=".">Period</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="How should NzbDrone separate sections of the filename?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -143,9 +113,6 @@
|
|||
<option value="2">S01E05</option>
|
||||
<option value="3">s01e05</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="What numbering style do you want?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -159,10 +126,7 @@
|
|||
<option value="2">Repeat</option>
|
||||
<option value="3">Scene</option>
|
||||
</select>
|
||||
<span class="help-inline">
|
||||
<i class="icon-question-sign" title="How will multi-episode files be named?"/>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</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>
|
|
@ -23,26 +23,6 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<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>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label">Nzb Restrictions</label>
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
'use strict';
|
||||
define(
|
||||
[
|
||||
'marionette',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Mixins/AsModelBoundView'
|
||||
], function (Marionette, NamingModel, AsModelBoundView) {
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template: 'Settings/Naming/NamingTemplate',
|
||||
|
||||
initialize: function () {
|
||||
this.model = new NamingModel();
|
||||
this.model.fetch();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return AsModelBoundView.call(view);
|
||||
});
|
|
@ -5,8 +5,8 @@ define(
|
|||
'marionette',
|
||||
'Settings/SettingsModel',
|
||||
'Settings/General/GeneralSettingsModel',
|
||||
'Settings/Naming/NamingModel',
|
||||
'Settings/Naming/NamingView',
|
||||
'Settings/MediaManagement/Naming/Model',
|
||||
'Settings/MediaManagement/Layout',
|
||||
'Settings/Quality/QualityLayout',
|
||||
'Settings/Indexers/CollectionView',
|
||||
'Settings/Indexers/Collection',
|
||||
|
@ -21,7 +21,7 @@ define(
|
|||
SettingsModel,
|
||||
GeneralSettingsModel,
|
||||
NamingModel,
|
||||
NamingView,
|
||||
MediaManagementLayout,
|
||||
QualityLayout,
|
||||
IndexerCollectionView,
|
||||
IndexerCollection,
|
||||
|
@ -35,47 +35,47 @@ define(
|
|||
template: 'Settings/SettingsLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
naming : '#naming',
|
||||
quality : '#quality',
|
||||
indexers : '#indexers',
|
||||
downloadClient: '#download-client',
|
||||
notifications : '#notifications',
|
||||
general : '#general',
|
||||
misc : '#misc',
|
||||
loading : '#loading-region'
|
||||
mediaManagement : '#media-management',
|
||||
quality : '#quality',
|
||||
indexers : '#indexers',
|
||||
downloadClient : '#download-client',
|
||||
notifications : '#notifications',
|
||||
general : '#general',
|
||||
misc : '#misc',
|
||||
loading : '#loading-region'
|
||||
},
|
||||
|
||||
ui: {
|
||||
namingTab : '.x-naming-tab',
|
||||
qualityTab : '.x-quality-tab',
|
||||
indexersTab : '.x-indexers-tab',
|
||||
downloadClientTab: '.x-download-client-tab',
|
||||
notificationsTab : '.x-notifications-tab',
|
||||
generalTab : '.x-general-tab',
|
||||
miscTab : '.x-misc-tab'
|
||||
mediaManagementTab : '.x-media-management-tab',
|
||||
qualityTab : '.x-quality-tab',
|
||||
indexersTab : '.x-indexers-tab',
|
||||
downloadClientTab : '.x-download-client-tab',
|
||||
notificationsTab : '.x-notifications-tab',
|
||||
generalTab : '.x-general-tab',
|
||||
miscTab : '.x-misc-tab'
|
||||
},
|
||||
|
||||
events: {
|
||||
'click .x-naming-tab' : 'showNaming',
|
||||
'click .x-quality-tab' : 'showQuality',
|
||||
'click .x-indexers-tab' : 'showIndexers',
|
||||
'click .x-download-client-tab': 'showDownloadClient',
|
||||
'click .x-notifications-tab' : 'showNotifications',
|
||||
'click .x-general-tab' : 'showGeneral',
|
||||
'click .x-misc-tab' : 'showMisc',
|
||||
'click .x-save-settings' : 'save'
|
||||
'click .x-media-management-tab' : '_showMediaManagement',
|
||||
'click .x-quality-tab' : '_showQuality',
|
||||
'click .x-indexers-tab' : '_showIndexers',
|
||||
'click .x-download-client-tab' : '_showDownloadClient',
|
||||
'click .x-notifications-tab' : '_showNotifications',
|
||||
'click .x-general-tab' : '_showGeneral',
|
||||
'click .x-misc-tab' : '_showMisc',
|
||||
'click .x-save-settings' : '_save'
|
||||
},
|
||||
|
||||
showNaming: function (e) {
|
||||
_showMediaManagement: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
||||
this.ui.namingTab.tab('show');
|
||||
this._navigate('settings/naming');
|
||||
this.ui.mediaManagementTab.tab('show');
|
||||
this._navigate('settings/mediamanagement');
|
||||
},
|
||||
|
||||
showQuality: function (e) {
|
||||
_showQuality: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ define(
|
|||
this._navigate('settings/quality');
|
||||
},
|
||||
|
||||
showIndexers: function (e) {
|
||||
_showIndexers: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ define(
|
|||
this._navigate('settings/indexers');
|
||||
},
|
||||
|
||||
showDownloadClient: function (e) {
|
||||
_showDownloadClient: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -102,7 +102,7 @@ define(
|
|||
this._navigate('settings/downloadclient');
|
||||
},
|
||||
|
||||
showNotifications: function (e) {
|
||||
_showNotifications: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -111,7 +111,7 @@ define(
|
|||
this._navigate('settings/notifications');
|
||||
},
|
||||
|
||||
showGeneral: function (e) {
|
||||
_showGeneral: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ define(
|
|||
this._navigate('settings/general');
|
||||
},
|
||||
|
||||
showMisc: function (e) {
|
||||
_showMisc: function (e) {
|
||||
if (e) {
|
||||
e.preventDefault();
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ define(
|
|||
this.notificationSettings.fetch()
|
||||
).done(function () {
|
||||
self.loading.$el.hide();
|
||||
self.naming.show(new NamingView());
|
||||
self.mediaManagement.show(new MediaManagementLayout({ settings: self.settings, namingSettings: self.namingSettings }));
|
||||
self.quality.show(new QualityLayout({settings: self.settings}));
|
||||
self.indexers.show(new IndexerCollectionView({collection: self.indexerSettings}));
|
||||
self.downloadClient.show(new DownloadClientLayout({model: self.settings}));
|
||||
|
@ -171,29 +171,29 @@ define(
|
|||
onShow: function () {
|
||||
switch (this.action) {
|
||||
case 'quality':
|
||||
this.showQuality();
|
||||
this._showQuality();
|
||||
break;
|
||||
case 'indexers':
|
||||
this.showIndexers();
|
||||
this._showIndexers();
|
||||
break;
|
||||
case 'downloadclient':
|
||||
this.showDownloadClient();
|
||||
this._showDownloadClient();
|
||||
break;
|
||||
case 'notifications':
|
||||
this.showNotifications();
|
||||
this._showNotifications();
|
||||
break;
|
||||
case 'general':
|
||||
this.showGeneral();
|
||||
this._showGeneral();
|
||||
break;
|
||||
case 'misc':
|
||||
this.showMisc();
|
||||
this._showMisc();
|
||||
break;
|
||||
default:
|
||||
this.showNaming();
|
||||
this._showMediaManagement();
|
||||
}
|
||||
},
|
||||
|
||||
save: function () {
|
||||
_save: function () {
|
||||
App.vent.trigger(App.Commands.SaveSettings);
|
||||
}
|
||||
});
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li><a href="#naming" class="x-naming-tab no-router">Naming</a></li>
|
||||
<li><a href="#media-management" class="x-media-management-tab no-router">Media Management</a></li>
|
||||
<li><a href="#quality" class="x-quality-tab no-router">Quality</a></li>
|
||||
<li><a href="#indexers" class="x-indexers-tab no-router">Indexers</a></li>
|
||||
<li><a href="#download-client" class="x-download-client-tab no-router">Download Client</a></li>
|
||||
|
@ -10,13 +10,13 @@
|
|||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="naming">Naming Settings</div>
|
||||
<div class="tab-pane" id="quality">Quality Settings</div>
|
||||
<div class="tab-pane" id="indexers">Indexer Settings</div>
|
||||
<div class="tab-pane" id="download-client">Download Client Settings</div>
|
||||
<div class="tab-pane" id="notifications">Notification Settings</div>
|
||||
<div class="tab-pane" id="general">general Settings</div>
|
||||
<div class="tab-pane" id="misc">Misc Settings</div>
|
||||
<div class="tab-pane" id="media-management"></div>
|
||||
<div class="tab-pane" id="quality"></div>
|
||||
<div class="tab-pane" id="indexers"></div>
|
||||
<div class="tab-pane" id="download-client"></div>
|
||||
<div class="tab-pane" id="notifications"></div>
|
||||
<div class="tab-pane" id="general"></div>
|
||||
<div class="tab-pane" id="misc"></div>
|
||||
</div>
|
||||
|
||||
<div id="loading-region"></div>
|
Loading…
Add table
Add a link
Reference in a new issue