Add youtube to results, persist to mongo

This commit is contained in:
Jonathan Cremin 2014-12-05 16:26:01 +00:00
parent d675ac4e9f
commit f20fecf0d0
7 changed files with 125 additions and 31 deletions

View file

@ -17,10 +17,15 @@
</div>
<div class="row">
<% for (var i=0;i < items.length;i++) { var album = items[i]; %>
<div class="col-md-3 col-xs-6">
<% if (album.type != "video") { %><div class="col-md-3 col-xs-6"><% } else { %><div class="col-md-6 col-xs-12"><% } %>
<div class="service <%= i==0 ? "source-service" : "" %>">
<div class="matching-from"><%= i==0 ? "Found matches using this link" : "" %></div>
<% if (album.streamUrl) { %>
<% if (album.type == "video") { %>
<div class="js-video widescreen">
<iframe width="100%" src="//www.youtube.com/embed/<%= album.id %>" frameborder="0" allowfullscreen></iframe>
</div>
<a href="https://www.youtube.com/results?search_query=<%= items[0].name %> <%= items[0].artist.name %>">More Youtube matches</a>
<% } else if (album.streamUrl) { %>
<a href="<%= album.streamUrl %>"><img src="<%= album.artwork %>" class="img-rounded album-artwork" width="100%"></a>
<div class="service-link">
<a href="<%= album.streamUrl %>"><img src="/images/<%= album.service %>.png" class="img-rounded"></a>