mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Fixed adding multiple movies.
This commit is contained in:
parent
4f6380a73c
commit
329786365d
@ -120,16 +120,17 @@ module.exports = Marionette.Layout.extend({
|
||||
},
|
||||
|
||||
_onMoviesAdded : function(options) {
|
||||
if (this.isExisting && options.movies.get('path') === this.model.get('folder').path) {
|
||||
if (this.isExisting && options.movie.get('path') === this.model.get('folder').path) {
|
||||
this.close();
|
||||
}
|
||||
|
||||
else if (!this.isExisting) {
|
||||
this.collection.term = '';
|
||||
this.resultCollectionView.setExisting(options.movie.get('imdbId'))
|
||||
/*this.collection.term = '';
|
||||
this.collection.reset();
|
||||
this._clearResults();
|
||||
this.ui.moviesSearch.val('');
|
||||
this.ui.moviesSearch.focus();
|
||||
this.ui.moviesSearch.focus();*/ //TODO: Maybe add option wheter to clear search result.
|
||||
}
|
||||
},
|
||||
|
||||
@ -143,6 +144,7 @@ module.exports = Marionette.Layout.extend({
|
||||
},
|
||||
|
||||
_clearResults : function() {
|
||||
|
||||
if (!this.isExisting) {
|
||||
this.searchResult.show(new EmptyView());
|
||||
} else {
|
||||
|
@ -21,6 +21,18 @@ module.exports = Marionette.CollectionView.extend({
|
||||
return this.showing >= this.collection.length;
|
||||
},
|
||||
|
||||
setExisting : function(imdbid) {
|
||||
var movies = this.collection.where({ imdbId : imdbid });
|
||||
console.warn(movies)
|
||||
//debugger;
|
||||
if (movies.length > 0) {
|
||||
this.children.findByModel(movies[0])._configureTemplateHelpers();
|
||||
//this.children.findByModel(movies[0])._configureTemplateHelpers();
|
||||
this.children.findByModel(movies[0]).render();
|
||||
//this.templateHelpers.existing = existingMovies[0].toJSON();
|
||||
}
|
||||
},
|
||||
|
||||
appendHtml : function(collectionView, itemView, index) {
|
||||
if (!this.isExisting || index < this.showing || index === 0) {
|
||||
collectionView.$el.append(itemView.el);
|
||||
|
@ -2,7 +2,11 @@
|
||||
<div class="row">
|
||||
<div class="col-md-2">
|
||||
<a href="{{imdbUrl}}" target="_blank">
|
||||
{{#if remotePoster}}
|
||||
{{remotePoster}}
|
||||
{{else}}
|
||||
{{poster}}
|
||||
{{/if}}
|
||||
</a>
|
||||
</div>
|
||||
<div class="col-md-10">
|
||||
@ -74,7 +78,7 @@
|
||||
<i class="icon-sonarr-add"></i>
|
||||
</button>
|
||||
|
||||
<button class="btn btn-success add x-add-search" title="Add and Search for missing episodes">
|
||||
<button class="btn btn-success add x-add-search" title="Add and Search for movie">
|
||||
<i class="icon-sonarr-search"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -19,6 +19,22 @@ Handlebars.registerHelper('poster', function() {
|
||||
return new Handlebars.SafeString('<img class="series-poster placeholder-image" src="{0}">'.format(placeholder));
|
||||
});
|
||||
|
||||
Handlebars.registerHelper('remotePoster', function() {
|
||||
var placeholder = StatusModel.get('urlBase') + '/Content/Images/poster-dark.png';
|
||||
var poster = this.remotePoster;
|
||||
|
||||
if (poster) {
|
||||
if (!poster.match(/^https?:\/\//)) {
|
||||
return new Handlebars.SafeString('<img class="series-poster x-series-poster" {0}>'.format(Handlebars.helpers.defaultImg.call(null, poster, 250)));
|
||||
} else {
|
||||
var url = poster.replace(/^https?\:/, 'https://'); //IMDb posters need https to work, k?
|
||||
return new Handlebars.SafeString('<img class="series-poster x-series-poster" {0}>'.format(Handlebars.helpers.defaultImg.call(null, url)));
|
||||
}
|
||||
}
|
||||
|
||||
return new Handlebars.SafeString('<img class="series-poster placeholder-image" src="{0}">'.format(placeholder));
|
||||
})
|
||||
|
||||
Handlebars.registerHelper('traktUrl', function() {
|
||||
return 'http://trakt.tv/search/tvdb/' + this.tvdbId + '?id_type=show';
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user