Browse Source

Add Rating / Genre to Dashboard Suggestions

Add Rating and up to 3 Genres to movie suggestions, to avoid constantly
jumping through to IMDB site.
pull/1938/head
dkboy 12 years ago
parent
commit
9be10f7b79
  1. 19
      couchpotato/core/plugins/movie/static/search.js
  2. 7
      couchpotato/core/plugins/suggestion/static/suggest.css

19
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<data.length && i<3;i++) {
genres[i] = data[i];
}
return genres.join(' | ');
},
getTitle: function(){
var self = this;
try {

7
couchpotato/core/plugins/suggestion/static/suggest.css

@ -42,6 +42,8 @@
line-height: 18px;
}
.suggestions .movie_result .data .info .rating,
.suggestions .movie_result .data .info .genres,
.suggestions .movie_result .data .info .year {
position: static;
display: block;
@ -50,6 +52,11 @@
opacity: .6;
}
.suggestions .movie_result .data .info .rating,
.suggestions .movie_result .data .info .genres {
font-size: 10px;
}
.suggestions .movie_result .data {
cursor: default;
}

Loading…
Cancel
Save