diff --git a/app/components/client/playground-scripts.js b/app/components/client/playground-scripts.js index 5de27e0..0cab01f 100644 --- a/app/components/client/playground-scripts.js +++ b/app/components/client/playground-scripts.js @@ -170,7 +170,7 @@ function fetchMetadata(exampleNumber, data) { send({ claim: data, message: "fetch metadata", - method: "claim_tip", + method: "support_create", example: exampleNumber }); @@ -193,7 +193,7 @@ function getMemeInfo() { // TODO: Error handling language: document.getElementById("meme-language").value, license: document.getElementById("meme-license").value, name: document.getElementById("meme-title").value, - nsfw: document.getElementById("meme-nsfw-flag").checked, + tags: document.getElementById("meme-nsfw-flag").checked ? "mature" : "[]", title: document.getElementById("meme-title").value }; } @@ -216,7 +216,7 @@ function initializePlayground() { function playgroundResponseForExample1(source) { return `
# With the LBRY app/daemon running locally, you can use this in your Terminal
-curl --header "Content-Type: application/json" --data '{ "method": "resolve", "params": { "uri": "${source}" }}' http://localhost:5279    
+curl --header "Content-Type: application/json" --data '{ "method": "resolve", "params": { "urls": "${source}" }}' http://localhost:5279    
 
@@ -227,7 +227,7 @@ curl --header "Content-Type: application/json" function playgroundResponseForExample2(source) { return `
# With the LBRY app/daemon running locally, you can use this in your Terminal
-curl --header "Content-Type: application/json" --data '{ "method": "publish", "params": { "name": "${source.name}", "file_path": "ABSOLUTE_PATH_TO_MEDIA_ON_YOUR_COMPUTER", "bid": "0.001", "metadata": { "description": "${source.description}", "title": "${source.title}", "language": "${source.language}", "license": "${source.license}", "nsfw": ${source.nsfw} }}}' http://localhost:5279    
+curl --header "Content-Type: application/json" --data '{ "method": "publish", "params": { "name": "${source.name}", "file_path": "ABSOLUTE_PATH_TO_MEDIA_ON_YOUR_COMPUTER", "bid": "0.001", "metadata": { "description": "${source.description}", "title": "${source.title}", "languages": "${source.language}", "license": "${source.license}", "tags": ${source.tags} }}}' http://localhost:5279    
 
@@ -240,7 +240,7 @@ function playgroundResponseForExample3(source) { return `
# With the LBRY app/daemon running locally, you can use this in your Terminal
-curl --header "Content-Type: application/json" --data '{ "method": "claim_tip", "params": { "amount": "0.001", "claim_id": "${source}" }}' http://localhost:5279    
+curl --header "Content-Type: application/json" --data '{ "method": "support_create", "params": { "amount": "0.001", "claim_id": "${source}", "--tip" }}' http://localhost:5279    
 
diff --git a/app/helpers/fetch-metadata.js b/app/helpers/fetch-metadata.js index 61802df..a6fcced 100644 --- a/app/helpers/fetch-metadata.js +++ b/app/helpers/fetch-metadata.js @@ -18,7 +18,7 @@ import { send } from "~socket"; import uploadImage from "./upload-image"; const allowedQueryMethods = [ - "claim_tip", + "support_create", "publish", "resolve" ]; @@ -79,7 +79,7 @@ export default async(data, socket) => { switch(true) { // T I P // E X A M P L E - case resolveMethod === "claim_tip": + case resolveMethod === "support_create": if (!approvedContentIdsForTipping.includes(claimAddress)) { return send(socket, { example: data.example, @@ -95,6 +95,7 @@ export default async(data, socket) => { apiRequestMethod = "POST"; body.amount = "0.001"; // Hardcoded tip amount body.claim_id = claimAddress; + body.tip = true; break; @@ -109,11 +110,11 @@ export default async(data, socket) => { body.author = "lbry.tech"; body.bid = "0.001"; // Hardcoded publish amount body.description = dataDetails.description; - body.language = dataDetails.language; + body.languages = [dataDetails.language]; body.license = dataDetails.license; body.name = dataDetails.name + "-" + randomString(10); - body.nsfw = dataDetails.nsfw; body.title = dataDetails.title; + body.tags = dataDetails.tags; // Gotta let the blockchain know what to save body.file_path = dataDetails.file_path; @@ -128,7 +129,7 @@ export default async(data, socket) => { switch(true) { case data.example === 2: case memePublishResponse.result: - case memePublishResponse.result.claim_address: + case memePublishResponse.result.outputs[0].address: explorerNotice = memePublishMessaging(memePublishResponse); break; @@ -280,11 +281,11 @@ function memePublishMessaging(source) {

- To see Proof of Work (lol) that your meme is on the LBRY blockchain, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed. + To see Proof of Work (lol) that your meme is on the LBRY blockchain, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed.

- You can also check out your meme (once the transaction is confirmed) on LBRY or Spee.ch! + You can also check out your meme (once the transaction is confirmed) on LBRY or Spee.ch!


@@ -294,8 +295,7 @@ function memePublishMessaging(source) { function tipCompletionMessaging(source) { return `

- If you want proof of the tip you just gave on behalf of LBRY, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed. + If you want proof of the tip you just gave on behalf of LBRY, check it out on our blockchain explorer! Please note that it may take a couple minutes for the transaction to be confirmed.


`; } - diff --git a/app/sockets.js b/app/sockets.js index 1b8322b..f5cc29f 100644 --- a/app/sockets.js +++ b/app/sockets.js @@ -123,11 +123,11 @@ function generateContent(exampleNumber, displayTrendingContent) { class="media__thumb" data-action="choose claim" data-claim-id="${part.name}" - ${part.value.stream.metadata.thumbnail.length ? `style="background-image: url(${makeImageSourceSecure(part.value.stream.metadata.thumbnail)})"` : ""} + ${part.value.thumbnail.url.length ? `style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})"` : ""} >
- ${part.value.stream.metadata.title} + ${part.value.title}
@@ -169,14 +169,14 @@ function generateContent(exampleNumber, displayTrendingContent) { const renderedContentCollection = []; for (const url of approvedUrls) - rawContentCollection.push(fetchMetadata({ claim: url, method: "resolve", example: exampleNumber })); + rawContentCollection.push(fetchMetadata({ claim: url, method: "resolve", example: 1 })); return Promise.all(rawContentCollection).then(collection => { for (const part of collection) { if ( part && part.value && - part.value.stream.metadata.thumbnail && + part.value.thumbnail.url && part.channel_name ) { renderedContentCollection.push(` @@ -186,11 +186,11 @@ function generateContent(exampleNumber, displayTrendingContent) { data-action="choose claim" data-claim-id="${part.claim_id}" data-name=${part.name} - style="background-image: url(${makeImageSourceSecure(part.value.stream.metadata.thumbnail)})"> + style="background-image: url(${makeImageSourceSecure(part.value.thumbnail.url)})">
- ${part.value.stream.metadata.title} + ${part.value.title}
diff --git a/package.json b/package.json index a7fee68..5028741 100755 --- a/package.json +++ b/package.json @@ -12,10 +12,10 @@ "dependencies": { "@babel/polyfill": "^7.4.4", "@inc/fastify-ws": "^1.1.0", - "@octokit/rest": "^16.25.4", + "@octokit/rest": "^16.26.0", "@slack/client": "^5.0.1", - "async": "^2.6.2", - "async-es": "^2.6.2", + "async": "^3.0.0", + "async-es": "^3.0.0", "choo": "^6.13.3", "choo-async": "^0.1.1", "choo-devtools": "^2.5.1",