Add Rating / Genre to Dashboard Suggestions
Add Rating and up to 3 Genres to movie suggestions, to avoid constantly jumping through to IMDB site.
This commit is contained in:
1 parent
1f35d0ec2f
commit
9be10f7b79
2 files changed
+26
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user