From 9dc5283c93cfc8c530d5d010fd36accc1110a2bf Mon Sep 17 00:00:00 2001 From: Pierre Date: Thu, 2 Nov 2017 11:41:48 -0700 Subject: [PATCH 1/5] Slightly better wording (from/to) --- views/about.handlebars | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/about.handlebars b/views/about.handlebars index db20bad9..b6453990 100644 --- a/views/about.handlebars +++ b/views/about.handlebars @@ -9,7 +9,7 @@
-

Spee.ch is a media-hosting site that reads and publishes content from the LBRY blockchain.

+

Spee.ch is a media-hosting site that reads from and publishes content to the LBRY blockchain.

Spee.ch is a hosting service, but with the added benefit that it stores your content on a decentralized network of computers -- the LBRY network. This means that your images are stored in multiple locations without a single point of failure.

Contribute

If you have an idea for your own spee.ch-like site on top of LBRY, fork our github repo and go to town!

From 821dd6be411e3f508d37fe88293f37c984dd0741 Mon Sep 17 00:00:00 2001 From: bill bittner Date: Fri, 3 Nov 2017 17:10:08 -0700 Subject: [PATCH 2/5] made fixes based on JKs feedback --- helpers/sequelizeHelpers.js | 25 +++++++++++++++++++++++++ models/certificate.js | 29 +++-------------------------- models/claim.js | 27 ++------------------------- routes/api-routes.js | 3 +-- 4 files changed, 31 insertions(+), 53 deletions(-) create mode 100644 helpers/sequelizeHelpers.js diff --git a/helpers/sequelizeHelpers.js b/helpers/sequelizeHelpers.js new file mode 100644 index 00000000..3b36749d --- /dev/null +++ b/helpers/sequelizeHelpers.js @@ -0,0 +1,25 @@ +module.exports = { + returnShortId: function (result, longId) { + let claimIndex; + let shortId = longId.substring(0, 1); // default sort id is the first letter + let shortIdLength = 0; + // find the index of this claim id + claimIndex = result.findIndex(element => { + return element.claimId === longId; + }); + if (claimIndex < 0) { + throw new Error('claim id not found in claims list'); + } + // get an array of all claims with lower height + let possibleMatches = result.slice(0, claimIndex); + // remove certificates with the same prefixes until none are left. + while (possibleMatches.length > 0) { + shortIdLength += 1; + shortId = longId.substring(0, shortIdLength); + possibleMatches = possibleMatches.filter(element => { + return (element.claimId.substring(0, shortIdLength) === shortId); + }); + } + return shortId; + }, +}; diff --git a/models/certificate.js b/models/certificate.js index b68d6df5..1a79c72b 100644 --- a/models/certificate.js +++ b/models/certificate.js @@ -1,31 +1,8 @@ const logger = require('winston'); +const { returnShortId } = require('../helpers/sequelizeHelpers.js'); const NO_CHANNEL = 'NO_CHANNEL'; -function sortResult (result, longId) { - let claimIndex; - let shortId = longId.substring(0, 1); // default sort id is the first letter - let shortIdLength = 0; - // find the index of this certificate - claimIndex = result.findIndex(element => { - return element.claimId === longId; - }); - if (claimIndex < 0) { throw new Error('channelId not found in possible sorted list') } - // get an array of all certificates with lower height - let possibleMatches = result.slice(0, claimIndex); - // remove certificates with the same prefixes until none are left. - while (possibleMatches.length > 0) { - shortIdLength += 1; - shortId = longId.substring(0, shortIdLength); - possibleMatches = possibleMatches.filter(element => { - return (element.claimId.substring(0, shortIdLength) === shortId); - }); - } - // return the short Id - logger.debug('short channel id ===', shortId); - return shortId; -} - -module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, DOUBLE, Op }) => { +module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT }) => { const Certificate = sequelize.define( 'Certificate', { @@ -137,7 +114,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D case 0: throw new Error('That is an invalid channel name'); default: - return resolve(sortResult(result, longChannelId)); + return resolve(returnShortId(result, longChannelId)); } }) .catch(error => { diff --git a/models/claim.js b/models/claim.js index 64a54b02..3ebd3adb 100644 --- a/models/claim.js +++ b/models/claim.js @@ -1,30 +1,7 @@ const logger = require('winston'); +const { returnShortId } = require('../helpers/sequelizeHelpers.js'); const NO_CLAIM = 'NO_CLAIM'; -function sortResult (result, longId) { - let claimIndex; - let shortId = longId.substring(0, 1); // default sort id is the first letter - let shortIdLength = 0; - // find the index of this certificate - claimIndex = result.findIndex(element => { - return element.claimId === longId; - }); - if (claimIndex < 0) { throw new Error('claimid not found in possible sorted list') } - // get an array of all certificates with lower height - let possibleMatches = result.slice(0, claimIndex); - // remove certificates with the same prefixes until none are left. - while (possibleMatches.length > 0) { - shortIdLength += 1; - shortId = longId.substring(0, shortIdLength); - possibleMatches = possibleMatches.filter(element => { - return (element.claimId.substring(0, shortIdLength) === shortId); - }); - } - // return the short Id - logger.debug('short claim id ===', shortId); - return shortId; -} - module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, DOUBLE, Op }) => { const Claim = sequelize.define( 'Claim', @@ -194,7 +171,7 @@ module.exports = (sequelize, { STRING, BOOLEAN, INTEGER, TEXT, ARRAY, DECIMAL, D case 0: throw new Error('That is an invalid claim name'); default: - resolve(sortResult(result, claimId)); + resolve(returnShortId(result, claimId)); } }) .catch(error => { diff --git a/routes/api-routes.js b/routes/api-routes.js index 0c92879d..68fbf387 100644 --- a/routes/api-routes.js +++ b/routes/api-routes.js @@ -147,8 +147,7 @@ module.exports = (app) => { // route to get a short claim id from long claim Id app.get('/api/shortClaimId/:longId/:name', ({ originalUrl, ip, params }, res) => { // serve content - db.Claim - .getShortClaimIdFromLongClaimId(params.longId, params.name) + db.Claim.getShortClaimIdFromLongClaimId(params.longId, params.name) .then(shortId => { res.status(200).json(shortId); }) From 15ae01321e0eeb892970ae256677a4cb9fc6bf6f Mon Sep 17 00:00:00 2001 From: Mark Firth Date: Tue, 7 Nov 2017 01:12:22 +1000 Subject: [PATCH 3/5] Update general.css Add space to the top of the stand alone video page, centers the video, centers the text and adds a border to the video skin to separate it from the background. --- public/assets/css/general.css | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/public/assets/css/general.css b/public/assets/css/general.css index 66b10b2d..856bac83 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -152,7 +152,9 @@ a, a:visited { .link--primary, .link--primary:visited { color: #4156C5; } - +.link--primary.fine-print { + text-align: center; +} .link--nav { color: black; border-bottom: 2px solid white; @@ -516,8 +518,12 @@ table { } #video-player { - background-color: black; - cursor: pointer; + background-color: #fff; + cursor: pointer; + margin: 0 auto; + margin-top: 2%; + border: 1px solid #d0d0d0; + padding: 6px 6px 5px 6px; } .show-asset-light { @@ -582,4 +588,4 @@ table { text-align: center; padding: 1em 0px 1em 0px; width: 100%; -} \ No newline at end of file +} From 7b22fb62f2784a9ff7c176a657d02ba8226bf968 Mon Sep 17 00:00:00 2001 From: Mark Firth Date: Tue, 7 Nov 2017 11:26:17 +1000 Subject: [PATCH 4/5] #video-player Padding all 6px Padding should be 6px rather than padding: 6px 6px 5px 6px; --- public/assets/css/general.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/assets/css/general.css b/public/assets/css/general.css index 856bac83..2d51a5a5 100644 --- a/public/assets/css/general.css +++ b/public/assets/css/general.css @@ -523,7 +523,7 @@ table { margin: 0 auto; margin-top: 2%; border: 1px solid #d0d0d0; - padding: 6px 6px 5px 6px; + padding:6px; } .show-asset-light { From 0b415f2d9f27fd7134a169c4012897c58474b21b Mon Sep 17 00:00:00 2001 From: bill bittner Date: Wed, 8 Nov 2017 15:19:39 -0800 Subject: [PATCH 5/5] updated .gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 761ac590..a45e5a85 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules .idea -config/config.json \ No newline at end of file +config/config.json +config/sequelizeCliConfig.js +config/speechConfig.js \ No newline at end of file