Browse Source

Merge pull request #144 from PhillipLangMartinez/q-apps

fix publish metadata
q-apps
CalDescent 2 years ago committed by GitHub
parent
commit
710a654bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js
  2. 16
      qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js
  3. 39
      qortal-ui-plugins/plugins/utils/publish-image.js

2
qortal-ui-plugins/plugins/core/components/ChatGifs/ChatGifs.js

@ -520,7 +520,7 @@ setOpenGifModal: { attribute: false }
service: 'GIF_REPOSITORY',
identifier: this.newCollectionName,
parentEpml,
metaData: `title=${this.newCollectionName}`,
title: this.newCollectionName,
uploadType: 'zip',
selectedAddress: this.selectedAddress,
worker: this.webWorkerImage,

16
qortal-ui-plugins/plugins/core/qdn/browser/browser.src.js

@ -545,6 +545,14 @@ class WebBrowser extends LitElement {
let identifier = data.identifier;
const data64 = data.data64;
const filename = data.filename;
const title = data.title;
const description = data.description;
const category = data.category;
const tag1 = data.tag1;
const tag2 = data.tag2;
const tag3 = data.tag3;
const tag4 = data.tag4;
const tag5 = data.tag5;
if (data.identifier == null) {
identifier = 'default';
}
@ -566,6 +574,14 @@ class WebBrowser extends LitElement {
worker: worker,
isBase64: true,
filename: filename,
title,
description,
category,
tag1,
tag2,
tag3,
tag4,
tag5,
apiVersion: 2,
withFee: res2.userData.isWithFee === true ? true: false
});

39
qortal-ui-plugins/plugins/utils/publish-image.js

@ -19,9 +19,16 @@ export const publishData = async ({
worker,
isBase64,
filename,
metaData,
apiVersion,
withFee
withFee,
title,
description,
category,
tag1,
tag2,
tag3,
tag4,
tag5
}) => {
const validateName = async (receiverName) => {
let nameRes = await parentEpml.request("apiCall", {
@ -171,10 +178,6 @@ export const publishData = async ({
if (identifier != null && identifier.trim().length > 0) {
uploadDataUrl = `/arbitrary/${service}/${registeredName}/${identifier}${urlSuffix}?apiKey=${getApiKey()}`
if(metaData){
uploadDataUrl = `/arbitrary/${service}/${registeredName}/${identifier}${urlSuffix}?${metaData}&apiKey=${getApiKey()}`
}
}
if(withFee){
@ -184,6 +187,30 @@ export const publishData = async ({
if(filename != null && filename != "undefined"){
uploadDataUrl = uploadDataUrl + '&filename=' + encodeURIComponent(filename)
}
if(title != null && title != "undefined"){
uploadDataUrl = uploadDataUrl + '&title=' + encodeURIComponent(title)
}
if(description != null && description != "undefined"){
uploadDataUrl = uploadDataUrl + '&description=' + encodeURIComponent(description)
}
if(category != null && category != "undefined"){
uploadDataUrl = uploadDataUrl + '&category=' + encodeURIComponent(category)
}
if(tag1 != null && tag1 != "undefined"){
uploadDataUrl = uploadDataUrl + '&tag1=' + encodeURIComponent(tag1)
}
if(tag2 != null && tag2 != "undefined"){
uploadDataUrl = uploadDataUrl + '&tag2=' + encodeURIComponent(tag2)
}
if(tag3 != null && tag3 != "undefined"){
uploadDataUrl = uploadDataUrl + '&tag3=' + encodeURIComponent(tag3)
}
if(tag4 != null && tag4 != "undefined"){
uploadDataUrl = uploadDataUrl + '&tag4=' + encodeURIComponent(tag4)
}
if(tag5 != null && tag5 != "undefined"){
uploadDataUrl = uploadDataUrl + '&tag5=' + encodeURIComponent(tag5)
}
let uploadDataRes = await parentEpml.request("apiCall", {
type: "api",

Loading…
Cancel
Save