From 9be10f7b79d1454d83217489fa709c8e56e13de0 Mon Sep 17 00:00:00 2001 From: dkboy Date: Fri, 12 Jul 2013 21:49:24 +1200 Subject: [PATCH] Add Rating / Genre to Dashboard Suggestions Add Rating and up to 3 Genres to movie suggestions, to avoid constantly jumping through to IMDB site. --- .../core/plugins/movie/static/search.js | 19 +++++++++++++++++++ .../plugins/suggestion/static/suggest.css | 7 +++++++ 2 files changed, 26 insertions(+) diff --git a/couchpotato/core/plugins/movie/static/search.js b/couchpotato/core/plugins/movie/static/search.js index 5530505f..67f9755e 100644 --- a/couchpotato/core/plugins/movie/static/search.js +++ b/couchpotato/core/plugins/movie/static/search.js @@ -223,6 +223,14 @@ Block.Search.Item = new Class({ 'text': info.year }) : null ) + ).adopt( + self.rating = info.rating && info.rating.imdb.length > 0 && info.rating.imdb[0] != '0' ? new Element('span.rating', { + 'text': info.rating.imdb[0] + '/10' + }) : null + ).adopt( + self.genre = info.genres && info.genres.length > 0 ? new Element('span.genres', { + 'text': self.getGenres(info.genres) + }) : null ) ) ) @@ -241,6 +249,17 @@ Block.Search.Item = new Class({ self.alternative_titles.include(alternative); }, + getGenres: function(data){ + var self = this; + var genres = []; + + for (var i=0;i