1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

tmdb/imdb/tvdb etc. links

This commit is contained in:
Techywarrior 2013-04-05 11:35:37 -07:00
parent cbc59895cc
commit 304ae7bd1b
7 changed files with 52 additions and 15 deletions

View file

@ -269,5 +269,44 @@
return LibraryBrowser.getRandomMetroColor();
}
}
},
renderLinks: function (item) {
var page = $.mobile.activePage;
//console.log(item);
if (item.ProviderIds) {
var elem = $('#itemLink', page).show();
var html = 'Links:  ';
var links = [];
if (item.ProviderIds.Imdb) {
if (item.Type == "Movie" || item.Type == "Episode")
links.push('<a class="ui-link" href="http://www.imdb.com/title/' + item.ProviderIds.Imdb + '" target="_blank">IMDB</a>');
else if (item.Type == "Person")
links.push('<a class="ui-link" href="http://www.imdb.com/name/' + item.ProviderIds.Imdb + '" target="_blank">IMDB</a>');
}
if (item.ProviderIds.Tmdb) {
if (item.Type == "Movie")
links.push('<a class="ui-link" href="http://www.themoviedb.org/movie/' + item.ProviderIds.Tmdb + '" target="_blank">TMDB</a>');
else if (item.Type == "Person")
links.push('<a class="ui-link" href="http://www.themoviedb.org/person/' + item.ProviderIds.Tmdb + '" target="_blank">TMDB</a>');
}
if (item.ProviderIds.Tvdb)
links.push('<a class="ui-link" href="http://thetvdb.com/index.php?tab=series&id=' + item.ProviderIds.Tvdb + '" target="_blank">TVDB</a>');
if (item.ProviderIds.Tvcom)
links.push('<a class="ui-link" href="http://www.tv.com/shows/' + item.ProviderIds.Tvcom + '" target="_blank">TV.com</a>');
if (item.ProviderIds.Musicbrainz)
links.push('<a class="ui-link" href="http://musicbrainz.org/release/' + item.ProviderIds.Musicbrainz + '" target="_blank">MusicBrainz</a>');
if (item.ProviderIds.Gamesdb)
links.push('<a class="ui-link" href="http://www.games-db.com/Game/' + item.ProviderIds.Gamesdb + '" target="_blank">GamesDB</a>');
html += links.join('&nbsp;&nbsp;/&nbsp;&nbsp;');
$('#itemLinks', page).html(html);
} else {
$('#itemLinks', page).hide();
}
}
};