diff --git a/src/NzbDrone.Core/MetadataSource/TraktProxy.cs b/src/NzbDrone.Core/MetadataSource/TraktProxy.cs index 7443c97fc..be5b694fa 100644 --- a/src/NzbDrone.Core/MetadataSource/TraktProxy.cs +++ b/src/NzbDrone.Core/MetadataSource/TraktProxy.cs @@ -31,6 +31,18 @@ namespace NzbDrone.Core.MetadataSource { try { + if (title.StartsWith("imdb:") || title.StartsWith("imdbid:")) + { + var slug = title.Split(':')[1].TrimStart('t'); + + if (slug.IsNullOrWhiteSpace() || !slug.All(char.IsDigit) || slug.Length < 7) + { + return new List(); + } + + title = "tt" + slug; + } + if (title.StartsWith("tvdb:") || title.StartsWith("tvdbid:") || title.StartsWith("slug:")) { try diff --git a/src/UI/AddSeries/AddSeriesView.js b/src/UI/AddSeries/AddSeriesView.js index 199c823de..8ea8be65d 100644 --- a/src/UI/AddSeries/AddSeriesView.js +++ b/src/UI/AddSeries/AddSeriesView.js @@ -5,10 +5,11 @@ define( 'marionette', 'AddSeries/AddSeriesCollection', 'AddSeries/SearchResultCollectionView', + 'AddSeries/EmptyView', 'AddSeries/NotFoundView', 'Shared/LoadingView', 'underscore' - ], function (vent, Marionette, AddSeriesCollection, SearchResultCollectionView, NotFoundView, LoadingView, _) { + ], function (vent, Marionette, AddSeriesCollection, SearchResultCollectionView, EmptyView, NotFoundView, LoadingView, _) { return Marionette.Layout.extend({ template: 'AddSeries/AddSeriesViewTemplate', @@ -64,13 +65,14 @@ define( return; } - self.searchResult.close(); self._abortExistingSearch(); self.throttledSearch({ term: self.ui.seriesSearch.val() }); }); + this._clearResults(); + if (this.isExisting) { this.ui.searchBar.hide(); } @@ -104,7 +106,7 @@ define( else if (!this.isExisting) { this.collection.reset(); - this.searchResult.close(); + this._clearResults(); this.ui.seriesSearch.val(''); this.ui.seriesSearch.focus(); } @@ -118,6 +120,15 @@ define( this.ui.loadMore.hide(); } }, + + _clearResults: function () { + if (!this.isExisting) { + this.searchResult.show(new EmptyView()); + } + else { + this.searchResult.close(); + } + }, _showResults: function () { if (!this.isClosed) { @@ -139,6 +150,9 @@ define( console.log('aborting previous pending search request.'); this.currentSearchPromise.abort(); } + else { + this._clearResults(); + } } }); }); diff --git a/src/UI/AddSeries/EmptyView.js b/src/UI/AddSeries/EmptyView.js new file mode 100644 index 000000000..54aaa4af9 --- /dev/null +++ b/src/UI/AddSeries/EmptyView.js @@ -0,0 +1,11 @@ +'use strict'; + +define( + [ + 'marionette' + ], function (Marionette) { + + return Marionette.CompositeView.extend({ + template: 'AddSeries/EmptyViewTemplate' + }); + }); diff --git a/src/UI/AddSeries/EmptyViewTemplate.html b/src/UI/AddSeries/EmptyViewTemplate.html new file mode 100644 index 000000000..a56208736 --- /dev/null +++ b/src/UI/AddSeries/EmptyViewTemplate.html @@ -0,0 +1,3 @@ +
+ You can also search by tvdbid and imdbid using the tvdb: and imdb: prefixes. +
diff --git a/src/UI/AddSeries/addSeries.less b/src/UI/AddSeries/addSeries.less index eef54fb51..3a6357677 100644 --- a/src/UI/AddSeries/addSeries.less +++ b/src/UI/AddSeries/addSeries.less @@ -100,6 +100,11 @@ margin : 30px 0px; text-align: center; } + + .hint { + color : #999999; + font-style : italic; + } } li.add-new { diff --git a/src/UI/Cells/SeriesTitleCell.js b/src/UI/Cells/SeriesTitleCell.js index 2421ab72a..16add6278 100644 --- a/src/UI/Cells/SeriesTitleCell.js +++ b/src/UI/Cells/SeriesTitleCell.js @@ -5,7 +5,7 @@ define( ], function (TemplatedCell) { return TemplatedCell.extend({ - className: 'series-title', + className: 'series-title-cell', template : 'Cells/SeriesTitleTemplate' }); diff --git a/src/UI/Cells/cells.less b/src/UI/Cells/cells.less index 1a38b3865..67c567269 100644 --- a/src/UI/Cells/cells.less +++ b/src/UI/Cells/cells.less @@ -5,7 +5,7 @@ @import "../Content/mixins"; @import "../Content/variables"; -.series-title { +.series-title-cell { .text-overflow(); @media @sm { diff --git a/src/UI/System/Backup/BackupFilenameCell.js b/src/UI/System/Backup/BackupFilenameCell.js index f853bdf6e..d5582855e 100644 --- a/src/UI/System/Backup/BackupFilenameCell.js +++ b/src/UI/System/Backup/BackupFilenameCell.js @@ -5,7 +5,7 @@ define( ], function (TemplatedCell) { return TemplatedCell.extend({ - className: 'series-title', + className: 'series-title-cell', template : 'System/Backup/BackupFilenameCellTemplate' });