diff --git a/controllers/serveController.js b/controllers/serveController.js index 6771b9b3..ade51deb 100644 --- a/controllers/serveController.js +++ b/controllers/serveController.js @@ -56,7 +56,8 @@ function getAssetByLongClaimId (fullClaimId, name) { // if a result was found, return early with the result if (dataValues) { logger.debug('found a local file for this name and claimId'); - return resolve(dataValues); + resolve(dataValues); + return; } logger.debug('no local file found for this name and claimId'); // 2. if no local claim, resolve and get the claim diff --git a/models/index.js b/models/index.js index 5a8f4c41..6c4af15b 100644 --- a/models/index.js +++ b/models/index.js @@ -102,7 +102,7 @@ function getLongChannelIdFromShortChannelId (channelName, channelId) { function getLongChannelIdFromChannelName (channelName) { return new Promise((resolve, reject) => { db - .sequelize.query(`SELECT claimId, amount, height FROM Certificate WHERE name = '${channelName}' ORDER BY amount DESC, height ASC LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT }) + .sequelize.query(`SELECT claimId, amount, height FROM Certificate WHERE name = '${channelName}' ORDER BY effectiveAmount DESC, height ASC LIMIT 1;`, { type: db.sequelize.QueryTypes.SELECT }) .then(result => { switch (result.length) { case 0: @@ -286,6 +286,7 @@ db['getAllChannelClaims'] = (channelId) => { }; db['getLongClaimId'] = (claimName, claimId) => { + logger.debug(`getLongClaimId (${claimName}, ${claimId})`); if (claimId && (claimId.length === 40)) { return new Promise((resolve, reject) => resolve(claimId)); } else if (claimId && claimId.length < 40) { @@ -296,12 +297,13 @@ db['getLongClaimId'] = (claimName, claimId) => { }; db['getLongChannelId'] = (channelName, channelId) => { + logger.debug(`getLongChannelId (${channelName}, ${channelId})`); if (channelId && (channelId.length === 40)) { // full channel id return new Promise((resolve, reject) => resolve(channelId)); } else if (channelId && channelId.length < 40) { // short channel id return getLongChannelIdFromShortChannelId(channelName, channelId); } else { - return getLongChannelIdFromChannelName(channelName); + return getLongChannelIdFromChannelName(channelName); // no channelId provided } }; diff --git a/public/assets/css/general.css b/public/assets/css/general.css index 5fd9f91a..6a1a2167 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -413,7 +413,7 @@ table { .nav-bar-title-section { overflow: hidden; - border-bottom: 2px solid #eaeaea; + border-bottom: 0.5px solid #cacaca; position: relative; } @@ -437,7 +437,6 @@ table { .nav-bar-subtitle { font-size: small; - color:grey; position: absolute; left: 50%; top: 50%; @@ -446,28 +445,27 @@ table { .nav-bar-link { font-weight: normal; + color: grey; border-bottom: 2px solid white; } .nav-bar-link:hover { - color: dodgerblue; + color: black; } .nav-bar-link--active { - color: #1e90ff; - border-bottom: 2px solid dodgerblue; + color: black; + border-bottom: 2px solid black; } /* PUBLISH FORM */ .dropzone { - border: 2px dashed lightgrey; + border: 2px dashed dodgerblue; text-align: center; - background-color: white; } .dropzone:hover { - border: 2px dashed #1e90ff; - background-color: gainsboro; + border: 2px dashed lightgrey; cursor: pointer; } diff --git a/routes/serve-routes.js b/routes/serve-routes.js index 6a862c71..2cbdd74b 100644 --- a/routes/serve-routes.js +++ b/routes/serve-routes.js @@ -140,6 +140,7 @@ module.exports = (app) => { getAsset(claimType, channelName, channelId, name, claimId) // 2. serve or show .then(fileInfo => { + logger.debug('file info found:', fileInfo); if (!fileInfo) { res.status(200).render('noClaims'); } else { @@ -177,10 +178,20 @@ module.exports = (app) => { getChannelContents(channelName, channelId) // 2. respond to the request .then(result => { - const totalPages = determineTotalPages(result.claims.length); if (!result.claims) { - res.status(200).render('noChannel'); + res.status(200).render('channel', { + channelName : result.channelName, + longChannelId : result.longChannelId, + shortChannelId: result.shortChannelId, + claims : [], + previousPage : 0, + currentPage : 0, + nextPage : 0, + totalPages : 0, + totalResults : 0, + }); } else { + const totalPages = determineTotalPages(result.claims.length); res.status(200).render('channel', { channelName : result.channelName, longChannelId : result.longChannelId, diff --git a/views/index.handlebars b/views/index.handlebars index 4084e078..fa87c53d 100644 --- a/views/index.handlebars +++ b/views/index.handlebars @@ -1,4 +1,4 @@ -
By clicking 'Upload', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. [Read more]
-By clicking 'Upload', you affirm that you have the rights to publish this content to the LBRY network, and that you understand the properties of publishing it to a decentralized, user-controlled network. [Read more]
+