More bluebird, fetch larger artwork
This commit is contained in:
parent
e671b823e9
commit
23896f7ee6
16 changed files with 117 additions and 81 deletions
24
app.js
24
app.js
|
@ -35,18 +35,11 @@ app.use(session({
|
||||||
app.use(flash());
|
app.use(flash());
|
||||||
app.use(express.static(path.join(__dirname, 'public')));
|
app.use(express.static(path.join(__dirname, 'public')));
|
||||||
|
|
||||||
var db;
|
var dbUrl = process.env.MONGOHQ_URL || "mongodb://localhost/match-audio";
|
||||||
if (process.env.MONGOHQ_URL) {
|
|
||||||
console.log("Connecting to MongoHQ")
|
|
||||||
db = pmongo(process.env.MONGOHQ_URL, ['matches']);
|
|
||||||
} else {
|
|
||||||
db = pmongo('match-audio', ['matches']);
|
|
||||||
}
|
|
||||||
|
|
||||||
app.use(function(req, res, next) {
|
app.use(function(req, res, next) {
|
||||||
req.db = res.db = db;
|
req.db = res.db = pmongo(dbUrl, ['matches']);
|
||||||
next();
|
next();
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
app.get('*', function(req,res,next) {
|
app.get('*', function(req,res,next) {
|
||||||
|
@ -56,7 +49,7 @@ app.get('*', function(req,res,next) {
|
||||||
} else if (req.headers['cf-visitor']) {
|
} else if (req.headers['cf-visitor']) {
|
||||||
req.userProtocol = "https";
|
req.userProtocol = "https";
|
||||||
} else {
|
} else {
|
||||||
req.userProtocol = "http"
|
req.userProtocol = "http";
|
||||||
}
|
}
|
||||||
// redirect www
|
// redirect www
|
||||||
if (req.headers.host.match(/^www/) !== null ) {
|
if (req.headers.host.match(/^www/) !== null ) {
|
||||||
|
@ -67,15 +60,8 @@ app.get('*', function(req,res,next) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/', function(req, res) {
|
app.get('/', function(req, res) {
|
||||||
var samples = [
|
|
||||||
{artist: "Aesop Rock", album: "Skelethon", url: '/google/album/B3ppmqcekrmxln4bre33om3qife'},
|
|
||||||
{artist: "Hozier", album: "self-titled album", url: '/google/album/Bd3mxcy3otokg4yc45qktq7l35q'},
|
|
||||||
{artist: "Daft Punk", album: "Discovery", url: '/google/album/B4t6yqqvhnb2hy4st4uisjrcsrm'}
|
|
||||||
];
|
|
||||||
|
|
||||||
// shitty sort until I add more metadata on cached items
|
|
||||||
req.db.matches.find().sort({$natural:-1}).limit(6).toArray().then(function(docs){
|
req.db.matches.find().sort({$natural:-1}).limit(6).toArray().then(function(docs){
|
||||||
res.render('index', { page: "home", samples: samples, recent: docs, error: req.flash('search-error') });
|
res.render('index', { page: "home", recent: docs, error: req.flash('search-error') });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -33,27 +33,30 @@ module.exports.parseUrl = function(url) {
|
||||||
|
|
||||||
module.exports.lookupId = function(id, type) {
|
module.exports.lookupId = function(id, type) {
|
||||||
if (type == "album") {
|
if (type == "album") {
|
||||||
return request.get(apiRoot + "/albums/" + id + "/images/default?size=medium&client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
return request.get(apiRoot + "/albums/" + id + "/images/default?size=large&client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
||||||
var artwork = res.headers.location;
|
var artwork = {large: res.headers.location.replace("http:", "https:")};
|
||||||
return request.get(apiRoot + "/albums/" + id + "?client_id=" + credentials.key).promise().then(function(res) {
|
return request.get(apiRoot + "/albums/" + id + "/images/default?client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
||||||
if (!res.body.data) {
|
artwork.small = res.headers.location.replace("http:", "https:");
|
||||||
var error = new Error("Not Found");
|
return request.get(apiRoot + "/albums/" + id + "?client_id=" + credentials.key).promise().then(function(res) {
|
||||||
error.status = 404;
|
if (!res.body.data) {
|
||||||
throw error;
|
var error = new Error("Not Found");
|
||||||
}
|
error.status = 404;
|
||||||
var result = res.body.data;
|
throw error;
|
||||||
return {
|
|
||||||
service: "beats",
|
|
||||||
type: "album",
|
|
||||||
id: result.id,
|
|
||||||
name: result.title,
|
|
||||||
streamUrl: "https://listen.beatsmusic.com/albums/" + result.id,
|
|
||||||
purchaseUrl: null,
|
|
||||||
artwork: artwork.replace("http:", "https:"),
|
|
||||||
artist: {
|
|
||||||
name: result.artist_display_name
|
|
||||||
}
|
}
|
||||||
};
|
var result = res.body.data;
|
||||||
|
return {
|
||||||
|
service: "beats",
|
||||||
|
type: "album",
|
||||||
|
id: result.id,
|
||||||
|
name: result.title,
|
||||||
|
streamUrl: "https://listen.beatsmusic.com/albums/" + result.id,
|
||||||
|
purchaseUrl: null,
|
||||||
|
artwork: artwork,
|
||||||
|
artist: {
|
||||||
|
name: result.artist_display_name
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else if (type == "track") {
|
} else if (type == "track") {
|
||||||
|
@ -64,23 +67,26 @@ module.exports.lookupId = function(id, type) {
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
var result = res.body.data;
|
var result = res.body.data;
|
||||||
return request.get(apiRoot + "/albums/" + result.refs.album.id + "/images/default?size=medium&client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
return request.get(apiRoot + "/albums/" + result.refs.album.id + "/images/default?size=large&client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
||||||
var artwork = res.headers.location;
|
var artwork = {large: res.headers.location.replace("http:", "https:")};
|
||||||
return {
|
return request.get(apiRoot + "/albums/" + result.refs.album.id + "/images/default?client_id=" + credentials.key).redirects(0).promise().then(function(res) {
|
||||||
service: "beats",
|
artwork.small = res.headers.location.replace("http:", "https:");
|
||||||
type: "track",
|
return {
|
||||||
id: result.id,
|
service: "beats",
|
||||||
name: result.title,
|
type: "track",
|
||||||
streamUrl: "https://listen.beatsmusic.com/albums/" + result.refs.album.id + "/tracks/" + result.id,
|
id: result.id,
|
||||||
purchaseUrl: null,
|
name: result.title,
|
||||||
artwork: artwork.replace("http:", "https:"),
|
streamUrl: "https://listen.beatsmusic.com/albums/" + result.refs.album.id + "/tracks/" + result.id,
|
||||||
artist: {
|
purchaseUrl: null,
|
||||||
name: result.artist_display_name
|
artwork: artwork,
|
||||||
},
|
artist: {
|
||||||
album: {
|
name: result.artist_display_name
|
||||||
name: result.refs.album.display
|
},
|
||||||
}
|
album: {
|
||||||
};
|
name: result.refs.album.display
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -32,7 +32,10 @@ module.exports.lookupId = function(id, type) {
|
||||||
}
|
}
|
||||||
var cover = result.cover || result.album.cover;
|
var cover = result.cover || result.album.cover;
|
||||||
return request.get(cover).redirects(0).promise().then(function(res) {
|
return request.get(cover).redirects(0).promise().then(function(res) {
|
||||||
var artwork = res.headers.location.replace("120x120", "200x200");
|
var artwork = {
|
||||||
|
small: res.headers.location.replace("120x120", "200x200"),
|
||||||
|
large: res.headers.location.replace("120x120", "800x800")
|
||||||
|
};
|
||||||
if (type == "album") {
|
if (type == "album") {
|
||||||
return {
|
return {
|
||||||
service: "deezer",
|
service: "deezer",
|
||||||
|
|
|
@ -53,7 +53,10 @@ module.exports.lookupId = function(id, type) {
|
||||||
name: album.name,
|
name: album.name,
|
||||||
streamUrl: "https://play.google.com/music/listen#/album/" + album.albumId,
|
streamUrl: "https://play.google.com/music/listen#/album/" + album.albumId,
|
||||||
purchaseUrl: "https://play.google.com/store/music/album?id=" + album.albumId,
|
purchaseUrl: "https://play.google.com/store/music/album?id=" + album.albumId,
|
||||||
artwork: album.albumArtRef.replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: album.albumArtRef.replace("http:", "https:"),
|
||||||
|
large: album.albumArtRef.replace("http:", "https:")
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: album.artist
|
name: album.artist
|
||||||
}
|
}
|
||||||
|
@ -70,7 +73,10 @@ module.exports.lookupId = function(id, type) {
|
||||||
name: track.title,
|
name: track.title,
|
||||||
streamUrl: "https://play.google.com/music/listen#/track/" + track.nid + "/" + track.albumId,
|
streamUrl: "https://play.google.com/music/listen#/track/" + track.nid + "/" + track.albumId,
|
||||||
purchaseUrl: "https://play.google.com/store/music/album?id=" + track.albumId,
|
purchaseUrl: "https://play.google.com/store/music/album?id=" + track.albumId,
|
||||||
artwork: track.albumArtRef[0].url.replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: track.albumArtRef[0].url.replace("http:", "https:"),
|
||||||
|
large: track.albumArtRef[0].url.replace("http:", "https:")
|
||||||
|
},
|
||||||
album: {
|
album: {
|
||||||
name: track.album
|
name: track.album
|
||||||
},
|
},
|
||||||
|
|
|
@ -57,7 +57,10 @@ module.exports.lookupId = function(id, type, cc) {
|
||||||
name: result.trackName ? result.trackName : result.collectionName,
|
name: result.trackName ? result.trackName : result.collectionName,
|
||||||
streamUrl: null,
|
streamUrl: null,
|
||||||
purchaseUrl: result.collectionViewUrl,
|
purchaseUrl: result.collectionViewUrl,
|
||||||
artwork: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "200x200").replace("http://", ""),
|
artwork: {
|
||||||
|
small: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "200x200").replace("http://", ""),
|
||||||
|
large: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "600x600").replace("http://", ""),
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: result.artistName
|
name: result.artistName
|
||||||
}
|
}
|
||||||
|
@ -115,7 +118,10 @@ module.exports.search = function(data) {
|
||||||
name: result.trackName ? result.trackName : result.collectionName,
|
name: result.trackName ? result.trackName : result.collectionName,
|
||||||
streamUrl: null,
|
streamUrl: null,
|
||||||
purchaseUrl: result.collectionViewUrl,
|
purchaseUrl: result.collectionViewUrl,
|
||||||
artwork: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "200x200").replace("http://", ""),
|
artwork: {
|
||||||
|
small: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "200x200").replace("http://", ""),
|
||||||
|
large: "https://match.audio/itunes/" + result.artworkUrl100.replace("100x100", "600x600").replace("http://", ""),
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: result.artistName
|
name: result.artistName
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ module.exports.lookupId = function(id) {
|
||||||
var parsed = parse(result.shortUrl)
|
var parsed = parse(result.shortUrl)
|
||||||
var id = parsed.path.replace("/x/", "").replace("/", "");
|
var id = parsed.path.replace("/x/", "").replace("/", "");
|
||||||
var type = result.album ? "track" : "album";
|
var type = result.album ? "track" : "album";
|
||||||
|
|
||||||
var item = {
|
var item = {
|
||||||
service: "rdio",
|
service: "rdio",
|
||||||
type: type,
|
type: type,
|
||||||
|
@ -36,7 +37,10 @@ module.exports.lookupId = function(id) {
|
||||||
name: result.name,
|
name: result.name,
|
||||||
streamUrl: result.shortUrl,
|
streamUrl: result.shortUrl,
|
||||||
purchaseUrl: null,
|
purchaseUrl: null,
|
||||||
artwork: result.icon.replace("square-200", "square-250").replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: result.icon.replace("square-200", "square-250").replace("http:", "https:"),
|
||||||
|
large: result.icon.replace("square-200", "square-600").replace("http:", "https:")
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: result.artist
|
name: result.artist
|
||||||
}
|
}
|
||||||
|
@ -89,7 +93,10 @@ module.exports.parseUrl = function(url) {
|
||||||
name: result.name,
|
name: result.name,
|
||||||
streamUrl: result.shortUrl,
|
streamUrl: result.shortUrl,
|
||||||
purchaseUrl: null,
|
purchaseUrl: null,
|
||||||
artwork: result.icon.replace("square-200", "square-250").replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: result.icon.replace("square-200", "square-250").replace("http:", "https:"),
|
||||||
|
large: result.icon.replace("square-200", "square-600").replace("http:", "https:")
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: result.artist
|
name: result.artist
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,10 @@ module.exports.lookupId = function(id, type) {
|
||||||
name: data.name,
|
name: data.name,
|
||||||
streamUrl: "https://play.spotify.com/" + type + "/" + data.id,
|
streamUrl: "https://play.spotify.com/" + type + "/" + data.id,
|
||||||
purchaseUrl: null,
|
purchaseUrl: null,
|
||||||
artwork: data.images ? data.images[1].url.replace("http:", "https:") : data.album.images[1].url.replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: data.images[1].url.replace("http:", "https:"),
|
||||||
|
large: data.images[0].url.replace("http:", "https:"),
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: artist.name
|
name: artist.name
|
||||||
}
|
}
|
||||||
|
@ -46,7 +49,10 @@ module.exports.lookupId = function(id, type) {
|
||||||
name: data.name,
|
name: data.name,
|
||||||
streamUrl: "https://play.spotify.com/" + type + "/" + data.id,
|
streamUrl: "https://play.spotify.com/" + type + "/" + data.id,
|
||||||
purchaseUrl: null,
|
purchaseUrl: null,
|
||||||
artwork: data.images ? data.images[1].url.replace("http:", "https:") : data.album.images[1].url.replace("http:", "https:"),
|
artwork: {
|
||||||
|
small: data.album.images[1].url.replace("http:", "https:"),
|
||||||
|
large: data.album.images[0].url.replace("http:", "https:"),
|
||||||
|
},
|
||||||
artist: {
|
artist: {
|
||||||
name: artist.name
|
name: artist.name
|
||||||
},
|
},
|
||||||
|
|
|
@ -46,7 +46,10 @@ module.exports.search = function(data) {
|
||||||
name: result.snippet.title,
|
name: result.snippet.title,
|
||||||
streamUrl: "https://www.youtube.com/watch?v=" + result.id.videoId,
|
streamUrl: "https://www.youtube.com/watch?v=" + result.id.videoId,
|
||||||
purchaseUrl: null,
|
purchaseUrl: null,
|
||||||
artwork: result.snippet.thumbnails.medium.url,
|
artwork: {
|
||||||
|
small: result.snippet.thumbnails.medium.url,
|
||||||
|
large: result.snippet.thumbnails.high.url,
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -23,8 +23,7 @@ module.exports = function(req, res, next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
req.db.matches.findOne({_id:serviceId + "-" + itemId}).then(function(doc) {
|
||||||
req.db.matches.findOne({_id:serviceId + itemId}).then(function(doc) {
|
|
||||||
if (doc) {
|
if (doc) {
|
||||||
res.render(type, {
|
res.render(type, {
|
||||||
page: type,
|
page: type,
|
||||||
|
@ -58,7 +57,7 @@ module.exports = function(req, res, next) {
|
||||||
});
|
});
|
||||||
|
|
||||||
items.unshift(item);
|
items.unshift(item);
|
||||||
req.db.matches.save({_id:serviceId + itemId, items:items});
|
req.db.matches.save({_id:serviceId + "-" + itemId, items:items});
|
||||||
res.render(type, {
|
res.render(type, {
|
||||||
page: type,
|
page: type,
|
||||||
title: item.name + " by " + item.artist.name,
|
title: item.name + " by " + item.artist.name,
|
||||||
|
|
|
@ -12,6 +12,13 @@ describe('Google Play Music', function(){
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should find track by ID', function(done){
|
||||||
|
google.lookupId("Tjosptub24g2dft37lforqnudpe", "track").then(function(result) {
|
||||||
|
result.name.should.equal("Cherub Rock");
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('search', function(){
|
describe('search', function(){
|
||||||
|
|
|
@ -7,14 +7,14 @@ var itunes = require("../../lib/services/itunes");
|
||||||
describe('iTunes Music', function(){
|
describe('iTunes Music', function(){
|
||||||
describe('lookupId', function(){
|
describe('lookupId', function(){
|
||||||
it('should find album by ID', function(done){
|
it('should find album by ID', function(done){
|
||||||
itunes.lookupId("id215206912").then(function(result) {
|
itunes.lookupId("id215206912", "album").then(function(result) {
|
||||||
result.name.should.equal("Peace Orchestra");
|
result.name.should.equal("Peace Orchestra");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should find track by ID', function(done){
|
it('should find track by ID', function(done){
|
||||||
itunes.lookupId("id215206958").then(function(result) {
|
itunes.lookupId("id215206958", "track").then(function(result) {
|
||||||
result.name.should.equal("Double Drums");
|
result.name.should.equal("Double Drums");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,6 +12,13 @@ describe('Spotify', function(){
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should find track by ID', function(done){
|
||||||
|
spotify.lookupId("7dS5EaCoMnN7DzlpT6aRn2", "track").then(function(result) {
|
||||||
|
result.name.should.equal("Take Me To Church");
|
||||||
|
done();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('search', function(){
|
describe('search', function(){
|
||||||
|
|
|
@ -34,17 +34,17 @@
|
||||||
</div>
|
</div>
|
||||||
<a href="https://www.youtube.com/results?search_query=<%= items[0].name %> <%= items[0].artist.name %>">More Youtube matches</a>
|
<a href="https://www.youtube.com/results?search_query=<%= items[0].name %> <%= items[0].artist.name %>">More Youtube matches</a>
|
||||||
<% } else if (album.streamUrl) { %>
|
<% } else if (album.streamUrl) { %>
|
||||||
<a href="<%= album.streamUrl %>"><img src="<%= album.artwork %>" class="img-rounded album-artwork" width="100%"></a>
|
<a href="<%= album.streamUrl %>"><img src="<%= album.artwork.small %>" class="img-rounded album-artwork" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<a href="<%= album.streamUrl %>"><img src="/images/<%= album.service %>.png" class="img-rounded"></a>
|
<a href="<%= album.streamUrl %>"><img src="/images/<%= album.service %>.png" class="img-rounded"></a>
|
||||||
</div>
|
</div>
|
||||||
<% } else if (album.purchaseUrl) { %>
|
<% } else if (album.purchaseUrl) { %>
|
||||||
<a href="<%= album.purchaseUrl %>"><img src="<%= album.artwork %>" class="img-rounded album-artwork" width="100%"></a>
|
<a href="<%= album.purchaseUrl %>"><img src="<%= album.artwork.small %>" class="img-rounded album-artwork" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<a href="<%= album.purchaseUrl %>"><img src="/images/<%= album.service %>.png" class="img-rounded"></a>
|
<a href="<%= album.purchaseUrl %>"><img src="/images/<%= album.service %>.png" class="img-rounded"></a>
|
||||||
</div>
|
</div>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<img src="<%= items[0].artwork %>" class="img-rounded album-artwork not-found" width="100%"></a>
|
<img src="<%= items[0].artwork.small %>" class="img-rounded album-artwork not-found" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<img src="/images/<%= album.service %>.png" class="img-rounded not-found">
|
<img src="/images/<%= album.service %>.png" class="img-rounded not-found">
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -7,11 +7,11 @@
|
||||||
<meta name="description" content="">
|
<meta name="description" content="">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<% if (locals.items) { var item = items[0] %>
|
<% if (locals.items) { var item = items[0] %>
|
||||||
<meta name="twitter:card" content="summary">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
<meta name="twitter:site" content="@MatchAudio">
|
<meta name="twitter:site" content="@MatchAudio">
|
||||||
<meta name="twitter:title" property="og:title" content="<%= item.name + " by " + item.artist.name %>">
|
<meta name="twitter:title" property="og:title" content="<%= item.name + " by " + item.artist.name %>">
|
||||||
<meta name="twitter:description" property="og:description" content="We've matched this music on Rdio, Spotify, Deezer, Beats Music, Google Music and iTunes so you can open it in the service you use." />
|
<meta name="twitter:description" property="og:description" content="We've matched this music on Rdio, Spotify, Deezer, Beats Music, Google Music and iTunes so you can open it in the service you use." />
|
||||||
<meta name="twitter:image" property="og:image" content="<%= item.artwork %>" />
|
<meta name="twitter:image:src" property="og:image" content="<%= item.artwork.large %>" />
|
||||||
<meta property="og:url" content="<%= thisUrl %>" />
|
<meta property="og:url" content="<%= thisUrl %>" />
|
||||||
<% } %>
|
<% } %>
|
||||||
<link rel="shortcut icon" href="/images/favicon.png">
|
<link rel="shortcut icon" href="/images/favicon.png">
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
<div class="row recent">
|
<div class="row recent">
|
||||||
<% for (var i=0;i < recent.length;i++) { var item = recent[i].items[0]; %>
|
<% for (var i=0;i < recent.length;i++) { var item = recent[i].items[0]; %>
|
||||||
<div class="col-sm-4 col-xs-6">
|
<div class="col-sm-4 col-xs-6">
|
||||||
<a href="/<%= item.service.replace("playmusic", "") %>/<%= item.type %>/<%= item.id %>"><img src="<%= item.artwork %>" width="100%"></a>
|
<a href="/<%= item.service.replace("playmusic", "") %>/<%= item.type %>/<%= item.id %>"><img src="<%= item.artwork.small ? item.artwork.small : item.artwork %>" width="100%"></a>
|
||||||
</div>
|
</div>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -34,17 +34,17 @@
|
||||||
</div>
|
</div>
|
||||||
<a href="https://www.youtube.com/results?search_query=<%= items[0].name %> <%= items[0].artist.name %>">More Youtube matches</a>
|
<a href="https://www.youtube.com/results?search_query=<%= items[0].name %> <%= items[0].artist.name %>">More Youtube matches</a>
|
||||||
<% } else if (track.streamUrl) { %>
|
<% } else if (track.streamUrl) { %>
|
||||||
<a href="<%= track.streamUrl %>"><img src="<%= track.artwork %>" class="img-rounded album-artwork" width="100%"></a>
|
<a href="<%= track.streamUrl %>"><img src="<%= track.artwork.small %>" class="img-rounded album-artwork" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<a href="<%= track.streamUrl %>"><img src="/images/<%= track.service %>.png" class="img-rounded"></a>
|
<a href="<%= track.streamUrl %>"><img src="/images/<%= track.service %>.png" class="img-rounded"></a>
|
||||||
</div>
|
</div>
|
||||||
<% } else if (track.purchaseUrl) { %>
|
<% } else if (track.purchaseUrl) { %>
|
||||||
<a href="<%= track.purchaseUrl %>"><img src="<%= track.artwork %>" class="img-rounded album-artwork" width="100%"></a>
|
<a href="<%= track.purchaseUrl %>"><img src="<%= track.artwork.small %>" class="img-rounded album-artwork" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<a href="<%= track.purchaseUrl %>"><img src="/images/<%= track.service %>.png" class="img-rounded"></a>
|
<a href="<%= track.purchaseUrl %>"><img src="/images/<%= track.service %>.png" class="img-rounded"></a>
|
||||||
</div>
|
</div>
|
||||||
<% } else { %>
|
<% } else { %>
|
||||||
<img src="<%= items[0].artwork %>" class="img-rounded album-artwork not-found" width="100%"></a>
|
<img src="<%= items[0].artwork.small %>" class="img-rounded album-artwork not-found" width="100%"></a>
|
||||||
<div class="service-link">
|
<div class="service-link">
|
||||||
<img src="/images/<%= track.service %>.png" class="img-rounded not-found">
|
<img src="/images/<%= track.service %>.png" class="img-rounded not-found">
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue