diff --git a/NzbDrone.Core/MetadataSource/TraktProxy.cs b/NzbDrone.Core/MetadataSource/TraktProxy.cs
index 12e63e8d9..1730f777d 100644
--- a/NzbDrone.Core/MetadataSource/TraktProxy.cs
+++ b/NzbDrone.Core/MetadataSource/TraktProxy.cs
@@ -1,4 +1,5 @@
using System.Collections.Generic;
+using System.IO;
using System.Linq;
using NzbDrone.Core.MediaCover;
using NzbDrone.Core.MetadataSource.Trakt;
@@ -60,7 +61,7 @@ namespace NzbDrone.Core.MetadataSource
series.TitleSlug = show.url.ToLower().Replace("http://trakt.tv/show/", "");
series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Banner, Url = show.images.banner });
- series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Poster, Url = show.images.poster });
+ series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Poster, Url = GetPosterThumbnailUrl(show.images.poster) });
series.Images.Add(new MediaCover.MediaCover { CoverType = MediaCoverTypes.Fanart, Url = show.images.fanart });
return series;
}
@@ -79,6 +80,11 @@ namespace NzbDrone.Core.MetadataSource
return episode;
}
-
+ private static string GetPosterThumbnailUrl(string posterUrl)
+ {
+ var extension = Path.GetExtension(posterUrl);
+ var withoutExtension = posterUrl.Substring(0, posterUrl.Length - extension.Length);
+ return withoutExtension + "-138" + extension;
+ }
}
}
\ No newline at end of file
diff --git a/UI/.idea/jsLibraryMappings.xml b/UI/.idea/jsLibraryMappings.xml
index c09b6ec1f..c932efdc1 100644
--- a/UI/.idea/jsLibraryMappings.xml
+++ b/UI/.idea/jsLibraryMappings.xml
@@ -1,7 +1,7 @@
-
+
diff --git a/UI/AddSeries/Existing/FolderMatchResultViewTemplate.html b/UI/AddSeries/Existing/FolderMatchResultViewTemplate.html
deleted file mode 100644
index e2a39df7f..000000000
--- a/UI/AddSeries/Existing/FolderMatchResultViewTemplate.html
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
- {{title}} {{seriesYear}}
-
-
-
-
-
diff --git a/UI/AddSeries/Existing/ImportSeriesView.js b/UI/AddSeries/Existing/ImportSeriesView.js
index 217271f2d..675ec8510 100644
--- a/UI/AddSeries/Existing/ImportSeriesView.js
+++ b/UI/AddSeries/Existing/ImportSeriesView.js
@@ -2,9 +2,9 @@
define([
'app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection', 'Shared/NotificationCollection', 'AddSeries/Existing/UnmappedFolderModel', 'AddSeries/SearchResultCollection', 'Series/SeriesModel'], function (app, rootFolders, qualityProfileCollection, notificationCollection) {
-
NzbDrone.AddSeries.Existing.FolderMatchResultView = Backbone.Marionette.ItemView.extend({
- template: 'AddSeries/Existing/FolderMatchResultViewTemplate',
+ template: 'AddSeries/SearchResultTemplate',
+ className: 'search-item',
events: {
'click .x-btn-add': 'addSeries'
@@ -26,7 +26,6 @@ define([
path : path
});
-
var seriesCollection = new NzbDrone.Series.SeriesCollection();
seriesCollection.add(model);
@@ -44,17 +43,18 @@ define([
}
});
}
-
});
NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView = Backbone.Marionette.CompositeView.extend({
template : 'AddSeries/Existing/UnmappedFolderCompositeViewTemplate',
itemViewContainer: '.x-folder-name-match-results',
+ className : 'unmapped-folder-view',
itemView : NzbDrone.AddSeries.Existing.FolderMatchResultView,
events: {
- 'click .x-btn-search': 'search'
+ 'click .x-btn-search': 'search',
+ 'keydown .x-txt-search': 'keydown'
},
ui: {
@@ -64,20 +64,25 @@ define([
},
initialize: function () {
- this.collection = new NzbDrone.AddSeries.SearchResultCollection();
+ this.collection = new NzbDrone.Series.SeriesCollection();
+ this.collection.bind('reset', this.collectionReset, this);
+ },
+
+ onRender: function () {
+ this.collection.url = NzbDrone.Constants.ApiRoot + '/series/lookup';
+ this.resultView = new NzbDrone.AddSeries.SearchResultView({ collection: this.collection });
},
search: function () {
-
var icon = this.ui.searchButton.find('icon');
+ this.collection.reset();
icon.removeClass('icon-search').addClass('icon-spin icon-spinner disabled');
this.collection.fetch({
data : { term: this.ui.searchText.val() },
- success: function () {
+ success: function (collection) {
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
-
},
fail : function () {
icon.removeClass('icon-spin icon-spinner disabled').addClass('icon-search');
@@ -85,6 +90,19 @@ define([
});
},
+ keydown: function (e) {
+ var code = (e.keyCode ? e.keyCode : e.which);
+ if(code === 13) {
+ this.search();
+ }
+ },
+
+ collectionReset: function () {
+ _.each(this.collection.models, function (model){
+ model.set('isExisting', true);
+ });
+ },
+
itemViewOptions: function () {
return {
qualityProfile: this.ui.profileList,
@@ -92,15 +110,13 @@ define([
folder : this.model.get('folder')
};
}
-
-
-
});
NzbDrone.AddSeries.Existing.RootFolderCompositeView = Backbone.Marionette.CompositeView.extend({
template : "AddSeries/Existing/RootFolderCompositeViewTemplate",
itemViewContainer: ".x-existing-folder-container",
+ className : 'row',
itemView : NzbDrone.AddSeries.Existing.UnmappedFolderCompositeView,
initialize: function () {
@@ -117,9 +133,6 @@ define([
refreshItems: function () {
this.collection.importItems(this.model);
}
-
-
-
});
NzbDrone.AddSeries.Existing.ImportSeriesView = Backbone.Marionette.CollectionView.extend({
@@ -129,6 +142,5 @@ define([
initialize: function () {
this.collection = rootFolders;
}
-
});
});
diff --git a/UI/AddSeries/Existing/RootFolderCompositeViewTemplate.html b/UI/AddSeries/Existing/RootFolderCompositeViewTemplate.html
index 6e909cc0e..1f7e069f2 100644
--- a/UI/AddSeries/Existing/RootFolderCompositeViewTemplate.html
+++ b/UI/AddSeries/Existing/RootFolderCompositeViewTemplate.html
@@ -1,7 +1,6 @@
-
-
diff --git a/UI/AddSeries/Existing/UnmappedFolderCompositeViewTemplate.html b/UI/AddSeries/Existing/UnmappedFolderCompositeViewTemplate.html
index e26778a56..07e338fa6 100644
--- a/UI/AddSeries/Existing/UnmappedFolderCompositeViewTemplate.html
+++ b/UI/AddSeries/Existing/UnmappedFolderCompositeViewTemplate.html
@@ -1,21 +1,15 @@
-"use strict";
-