mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-27 22:57:09 -04:00
List sync with removal (#656)
This commit is contained in:
@@ -1,9 +1,70 @@
|
||||
var Marionette = require('marionette');
|
||||
var AsModelBoundView = require('../../../Mixins/AsModelBoundView');
|
||||
var AsValidatedView = require('../../../Mixins/AsValidatedView');
|
||||
var $ = require('jquery');
|
||||
require('../../../Mixins/TagInput');
|
||||
require('bootstrap');
|
||||
require('bootstrap.tagsinput');
|
||||
|
||||
var view = Marionette.ItemView.extend({
|
||||
template : 'Settings/NetImport/Options/NetImportOptionsViewTemplate'
|
||||
template : 'Settings/NetImport/Options/NetImportOptionsViewTemplate',
|
||||
|
||||
ui : {
|
||||
importExclusions : '.x-import-exclusions'
|
||||
},
|
||||
|
||||
onRender : function() {
|
||||
this.ui.importExclusions.tagsinput({
|
||||
trimValue : true,
|
||||
tagClass : 'label label-danger',
|
||||
itemText : function(item) {
|
||||
var uri;
|
||||
var text;
|
||||
if (item.startsWith('tt')) {
|
||||
uri = window.NzbDrone.ApiRoot + '/movies/lookup/imdb?imdbId='+item;
|
||||
}
|
||||
else {
|
||||
uri = window.NzbDrone.ApiRoot + '/movies/lookup/tmdb?tmdbId='+item;
|
||||
}
|
||||
var promise = $.ajax({
|
||||
url : uri,
|
||||
type : 'GET',
|
||||
async : false,
|
||||
});
|
||||
promise.success(function(response) {
|
||||
text=response['title']+' ('+response['year']+')';
|
||||
});
|
||||
|
||||
promise.error(function(request, status, error) {
|
||||
text=item;
|
||||
});
|
||||
return text;
|
||||
}
|
||||
});
|
||||
this.ui.importExclusions.on('beforeItemAdd', function(event) {
|
||||
var uri;
|
||||
if (event.item.startsWith('tt')) {
|
||||
uri = window.NzbDrone.ApiRoot + '/movies/lookup/imdb?imdbId='+event.item;
|
||||
}
|
||||
else {
|
||||
uri = window.NzbDrone.ApiRoot + '/movies/lookup/tmdb?tmdbId='+event.item;
|
||||
}
|
||||
var promise = $.ajax({
|
||||
url : uri,
|
||||
type : 'GET',
|
||||
async : false,
|
||||
});
|
||||
promise.success(function(response) {
|
||||
event.cancel=false;
|
||||
});
|
||||
|
||||
promise.error(function(request, status, error) {
|
||||
event.cancel = true;
|
||||
window.alert(event.item+' is not a valid! Must be valid tt#### IMDB ID or #### TMDB ID');
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
AsModelBoundView.call(view);
|
||||
|
||||
@@ -13,4 +13,32 @@
|
||||
<input type="number" name="netImportSyncInterval" class="form-control" min="0" max="1440"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Clean Library Level</label>
|
||||
<div class="col-sm-1 col-sm-push-2 help-inline">
|
||||
<i class="icon-sonarr-form-warning" title="Disable unless you are sure. Enabling Recycle bin before this is recommended"/>
|
||||
<i class="icon-sonarr-form-info" title="Movies in library will be removed or unmonitored if not found in your lists"/>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-2 col-sm-pull-1">
|
||||
<select name="listSyncLevel" class="form-control">
|
||||
<option value="disabled">Disabled</option>
|
||||
<option value="logOnly">LogOnly</option>
|
||||
<option value="keepAndUnmonitor">Keep but Unmonitor</option>
|
||||
<option value="removeAndKeep">Remove & Keep Files</option>
|
||||
<option value="removeAndDelete">Remove & Delete Files</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">Import Exclusions</label>
|
||||
<div class="col-sm-1 col-sm-push-2 help-inline">
|
||||
<i class="icon-sonarr-form-warning" title="Movies in this field will not be imported even if they exist on your lists."/>
|
||||
<i class="icon-sonarr-form-info" title="Comma separated imdbid or tmdbid: tt0120915,216138,tt0121765"/>
|
||||
</div>
|
||||
<div class="col-sm-2 col-sm-pull-1">
|
||||
|
||||
<input type="text" name="importExclusions" class="form-control x-import-exclusions"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
Reference in New Issue
Block a user