mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-23 14:55:20 -07:00
commit
0aa6066a6f
5 changed files with 68 additions and 17 deletions
|
@ -92,7 +92,7 @@ namespace NzbDrone.Core.NetImport
|
||||||
bool foundMatch = false;
|
bool foundMatch = false;
|
||||||
foreach (var listedMovie in listedMovies)
|
foreach (var listedMovie in listedMovies)
|
||||||
{
|
{
|
||||||
if (movie.ImdbId == listedMovie.ImdbId)
|
if (movie.TmdbId == listedMovie.TmdbId)
|
||||||
{
|
{
|
||||||
foundMatch = true;
|
foundMatch = true;
|
||||||
break;
|
break;
|
||||||
|
@ -146,14 +146,19 @@ namespace NzbDrone.Core.NetImport
|
||||||
{
|
{
|
||||||
foreach (var exclusion in importExclusions)
|
foreach (var exclusion in importExclusions)
|
||||||
{
|
{
|
||||||
if (exclusion == movie.ImdbId || exclusion == movie.TmdbId.ToString())
|
//var excludedTmdbId = exclusion.Substring(exclusion.LastIndexOf('-')+1);
|
||||||
|
int excludedTmdbId;
|
||||||
|
if (Int32.TryParse(exclusion.Substring(exclusion.LastIndexOf('-') + 1), out excludedTmdbId))
|
||||||
{
|
{
|
||||||
_logger.Info("Movie: {0} was found but will not be added because {1} was found on your exclusion list",movie, exclusion);
|
if (excludedTmdbId == movie.TmdbId)
|
||||||
|
{
|
||||||
|
_logger.Info("Movie: {0} was found but will not be added because {1} was found on your exclusion list", movie, exclusion);
|
||||||
shouldAdd = false;
|
shouldAdd = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var mapped = _movieSearch.MapMovieToTmdbMovie(movie);
|
var mapped = _movieSearch.MapMovieToTmdbMovie(movie);
|
||||||
if ((mapped != null) && shouldAdd)
|
if ((mapped != null) && shouldAdd)
|
||||||
|
|
|
@ -250,11 +250,11 @@ namespace NzbDrone.Core.Tv
|
||||||
{
|
{
|
||||||
if (_configService.ImportExclusions.Empty())
|
if (_configService.ImportExclusions.Empty())
|
||||||
{
|
{
|
||||||
_configService.ImportExclusions = movie.ImdbId;
|
_configService.ImportExclusions = movie.TitleSlug;
|
||||||
}
|
}
|
||||||
else if (!_configService.ImportExclusions.Contains(movie.ImdbId) && !_configService.ImportExclusions.Contains(movie.TmdbId.ToString()))
|
else if (!_configService.ImportExclusions.Contains(movie.TitleSlug))
|
||||||
{
|
{
|
||||||
_configService.ImportExclusions += ',' + movie.ImdbId;
|
_configService.ImportExclusions += ',' + movie.TitleSlug;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_movieRepository.Delete(movieId);
|
_movieRepository.Delete(movieId);
|
||||||
|
|
49
src/UI/JsLibraries/bootstrap.tagsinput.js
vendored
49
src/UI/JsLibraries/bootstrap.tagsinput.js
vendored
|
@ -95,6 +95,37 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
var itemValue = self.options.itemValue(item),
|
||||||
|
itemText = self.options.itemText(item),
|
||||||
|
tagClass = self.options.tagClass(item);
|
||||||
|
|
||||||
|
// Ignore items allready added
|
||||||
|
var existing = $.grep(self.itemsArray, function(item) { return self.options.itemValue(item) === itemValue; } )[0];
|
||||||
|
if (existing && !self.options.allowDuplicates) {
|
||||||
|
// Invoke onTagExists
|
||||||
|
if (self.options.onTagExists) {
|
||||||
|
var $existingTag = $(".tag", self.$container).filter(function() { return $(this).data("item") === existing; });
|
||||||
|
self.options.onTagExists(item, $existingTag);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if length greater than limit
|
||||||
|
if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
|
||||||
|
return;
|
||||||
|
*/
|
||||||
|
// raise beforeItemAdd arg
|
||||||
|
var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false });
|
||||||
|
self.$element.trigger(beforeItemAddEvent);
|
||||||
|
if (beforeItemAddEvent.cancel)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// register item in internal array and map
|
||||||
|
//self.itemsArray.push(item);
|
||||||
|
|
||||||
|
// read var beforeItemAddEvent with new value
|
||||||
|
var item = beforeItemAddEvent.item; // Get text from event (BeforeItemAddEvent)
|
||||||
var itemValue = self.options.itemValue(item),
|
var itemValue = self.options.itemValue(item),
|
||||||
itemText = self.options.itemText(item),
|
itemText = self.options.itemText(item),
|
||||||
tagClass = self.options.tagClass(item);
|
tagClass = self.options.tagClass(item);
|
||||||
|
@ -114,15 +145,23 @@
|
||||||
if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
|
if (self.items().toString().length + item.length + 1 > self.options.maxInputLength)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// raise beforeItemAdd arg
|
|
||||||
var beforeItemAddEvent = $.Event('beforeItemAdd', { item: item, cancel: false });
|
|
||||||
self.$element.trigger(beforeItemAddEvent);
|
|
||||||
if (beforeItemAddEvent.cancel)
|
|
||||||
return;
|
|
||||||
|
|
||||||
// register item in internal array and map
|
// register item in internal array and map
|
||||||
self.itemsArray.push(item);
|
self.itemsArray.push(item);
|
||||||
|
|
||||||
|
if (beforeItemAddEvent.tagClass !== undefined){ var tagClass = beforeItemAddEvent.tagClass; }
|
||||||
|
if (item != undefined){
|
||||||
|
var items = item.toString().split(',');
|
||||||
|
if (items.length > 1) {
|
||||||
|
for (var i = 0; i < items.length; i++) {
|
||||||
|
this.add(items[i], true);
|
||||||
|
}
|
||||||
|
if (!dontPushVal)
|
||||||
|
self.pushVal(self.options.triggerChange);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add a tag element
|
// add a tag element
|
||||||
var $tag = $('<span class="tag ' + htmlEncode(tagClass) + '">' + htmlEncode(itemText) + '<span data-role="remove"></span></span>');
|
var $tag = $('<span class="tag ' + htmlEncode(tagClass) + '">' + htmlEncode(itemText) + '<span data-role="remove"></span></span>');
|
||||||
$tag.data('item', item);
|
$tag.data('item', item);
|
||||||
|
|
|
@ -90,12 +90,19 @@ var view = Marionette.ItemView.extend({
|
||||||
});
|
});
|
||||||
promise.success(function(response) {
|
promise.success(function(response) {
|
||||||
event.cancel=false;
|
event.cancel=false;
|
||||||
|
|
||||||
|
//var newText = response['tmdbId']+'-';
|
||||||
|
//if (event.item.startsWith('tt')) {
|
||||||
|
// newText = newText+'['+event.item+']';
|
||||||
|
//}
|
||||||
|
event.item = response['titleSlug'];//+' ('+response['year']+')-'+response['tmdbId'];
|
||||||
});
|
});
|
||||||
|
|
||||||
promise.error(function(request, status, error) {
|
promise.error(function(request, status, error) {
|
||||||
event.cancel = true;
|
event.cancel = true;
|
||||||
window.alert(event.item+' is not a valid! Must be valid tt#### IMDB ID or #### TMDB ID');
|
window.alert(event.item+' is not a valid! Must be valid tt#### IMDB ID or #### TMDB ID');
|
||||||
});
|
});
|
||||||
|
return event;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -32,11 +32,11 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-3 control-label">Import Exclusions</label>
|
<label class="col-sm-3 control-label">Import Exclusions</label>
|
||||||
<div class="col-sm-1 col-sm-push-2 help-inline">
|
<div class="col-sm-1 col-sm-push-4 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-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"/>
|
<i class="icon-sonarr-form-info" title="Comma separated imdbid or tmdbid: tt0120915,216138,tt0121765"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-2 col-sm-pull-1">
|
<div class="col-sm-4 col-sm-pull-1">
|
||||||
|
|
||||||
<input type="text" name="importExclusions" class="form-control x-import-exclusions"/>
|
<input type="text" name="importExclusions" class="form-control x-import-exclusions"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue