diff --git a/components/IscnRegisterForm.vue b/components/IscnRegisterForm.vue
index d818b144..101629b9 100644
--- a/components/IscnRegisterForm.vue
+++ b/components/IscnRegisterForm.vue
@@ -355,6 +355,15 @@
:placeholder="$t('IscnRegisterForm.placeholder.url')"
/>
+
+
+
@@ -785,8 +795,10 @@ export default class IscnRegisterForm extends Vue {
tags: string[] = []
sameAs: string[] = []
url: string = ''
+ isbn: string = ''
license: string = this.licenseOptions[0]
customLicense: string = ''
+ thumbnailUrl: string = ''
authorName: string = ''
authorUrl: string[] = []
authorWalletAddress: string[] = []
@@ -990,6 +1002,7 @@ export default class IscnRegisterForm extends Vue {
tagsString: this.tagsString,
sameAs: this.formattedSameAsList,
url: this.url,
+ isbn: this.isbn,
exifInfo: this.exif.filter(file => file),
license: this.formattedLicense,
ipfsHash: this.ipfsHashList,
@@ -1005,7 +1018,7 @@ export default class IscnRegisterForm extends Vue {
authorDescriptions: this.authorDescriptions,
contentFingerprints: this.customContentFingerprints,
inLanguage: this.language,
- thumbnail: this.epubMetadata.thumbnail,
+ thumbnailUrl: this.thumbnailUrl,
}
}
@@ -1091,6 +1104,7 @@ export default class IscnRegisterForm extends Vue {
this.author.name = this.epubMetadata.author;
this.language = this.epubMetadata.language
this.tags = this.epubMetadata.tags
+ this.thumbnailUrl = this.epubMetadata.thumbnailUrl
if (this.author.name) { this.authors.push(this.author) }
}
diff --git a/components/IscnUploadForm.vue b/components/IscnUploadForm.vue
index bdc8c72e..bd0e3af9 100644
--- a/components/IscnUploadForm.vue
+++ b/components/IscnUploadForm.vue
@@ -264,7 +264,7 @@ import ePub from 'epubjs';
import { OfflineSigner } from '@cosmjs/proto-signing'
-import { IS_CHAIN_UPGRADING, UPLOAD_FILESIZE_MAX, IPFS_VIEW_GATEWAY_URL } from '~/constant'
+import { IS_CHAIN_UPGRADING, UPLOAD_FILESIZE_MAX } from '~/constant'
import { logTrackerEvent } from '~/utils/logger'
import { estimateBundlrFilePrice, uploadSingleFileToBundlr } from '~/utils/arweave/v2'
import {
@@ -566,13 +566,6 @@ export default class UploadForm extends Vue {
}
epubMetadata.ipfsHash = ipfsHash
- epubMetadata.thumbnail = {
- "@type": "ImageObject",
- url: `${IPFS_VIEW_GATEWAY_URL}${ipfsHash}`,
- name: `${file.name}_cover`,
- description: `${file.name}_cover`,
- encodingFormat: "image/jpeg",
- };
const reader = new FileReader()
reader.onload = (e) => {
@@ -670,7 +663,7 @@ export default class UploadForm extends Vue {
this.sentArweaveTransactionHashes.set(ipfsHash, { transactionHash: '', arweaveId });
const metadata = this.epubMetadataList.find((data: any) => data.ipfsHash === ipfsHash)
if (metadata) {
- metadata.thumbnail.contentUrl = `https://arweave.net/${arweaveId}`;
+ metadata.thumbnailUrl = `ar://${arweaveId}`;
}
}
if (!this.arweaveFeeTargetAddress) {
@@ -747,9 +740,9 @@ export default class UploadForm extends Vue {
if (arweaveId) {
const uploadedData = this.sentArweaveTransactionHashes.get(records.ipfsHash) || {};
this.sentArweaveTransactionHashes.set(records.ipfsHash, { ...uploadedData, arweaveId });
- if (tempRecord.fileName === 'cover.jpeg') {
- const metadata = this.epubMetadataList.find((file: any) => file.ipfsHash === records.thumbnail.url)
- metadata.thumbnail.contentUrl = `https://arweave.net/${arweaveId}`
+ if (tempRecord.fileName.includes('cover.jpeg')) {
+ const metadata = this.epubMetadataList.find((file: any) => file.ipfsHash === records.ipfsHash)
+ metadata.thumbnailUrl = `ar://${arweaveId}`
}
this.$emit('arweaveUploaded', { arweaveId })
this.isOpenSignDialog = false
@@ -805,6 +798,16 @@ export default class UploadForm extends Vue {
}
const uploadArweaveIdList = Array.from(this.sentArweaveTransactionHashes.values()).map(entry => entry.arweaveId);
+ this.fileRecords.forEach((record: any, index:number) => {
+ if (this.sentArweaveTransactionHashes.has(record.ipfsHash)) {
+ const arweaveId = this.sentArweaveTransactionHashes.get(
+ record.ipfsHash,
+ )?.arweaveId
+ if (arweaveId) {
+ this.fileRecords[index].arweaveId = `ar://${arweaveId}`
+ }
+ }
+ })
this.$emit('submit', { fileRecords: this.fileRecords, arweaveIds: uploadArweaveIdList, epubMetadata: this.epubMetadataList[0] })
}
diff --git a/components/SameAsFieldList.vue b/components/SameAsFieldList.vue
index ce882d65..243d09d8 100644
--- a/components/SameAsFieldList.vue
+++ b/components/SameAsFieldList.vue
@@ -16,13 +16,13 @@
-
+
-
+
handleSelectValue({ value, index: i })"
/>
+
@Prop({ default: () => [] }) readonly currentList!: Array
+ @Prop({ default: () => [] }) readonly fileRecords!: Array
@Prop(String) readonly name!: string | undefined
sameAsList: any = [{
@@ -112,20 +120,27 @@ export default class WalletFieldList extends Vue {
id: `${list.url}-${list.filename}`,
filename: list.filename,
filetype: list.filetype || SAME_AS_FILE_TYPES[0],
+ originFileName: list.originFileName,
}))
} else if (this.formatUrlOptions.length) {
- this.sameAsList = this.formatUrlOptions.map((url, index) => ({
- url,
- id: `${url}-${index}`,
- filename: this.formatName,
- filetype: SAME_AS_FILE_TYPES[0],
- }))
+ this.sameAsList = this.formatUrlOptions.map((url, index) =>{
+ const originFile = this.fileRecords.find((file) => (file.arweaveId === url))
+ const formattedFileType = this.formatFileType(originFile.fileType);
+ return{
+ url,
+ id: `${url}-${index}`,
+ filename: this.formatName,
+ filetype: formattedFileType || SAME_AS_FILE_TYPES[0],
+ originFileName: originFile.fileName,
+ }
+ })
} else {
this.sameAsList = [{
url: '',
id: 1,
filename: this.formatName,
filetype: SAME_AS_FILE_TYPES[0],
+ originFileName:'',
}]
}
}
@@ -159,5 +174,34 @@ export default class WalletFieldList extends Vue {
this.deleteEmptyField()
this.$emit('onConfirm', this.sameAsList)
}
+
+ // eslint-disable-next-line class-methods-use-this
+ formatFileType(fileType: string) {
+ let formattedFileType = ''
+ if (fileType) {
+ switch (true) {
+ case fileType.includes('jpg'):
+ case fileType.includes('jpeg'):
+ formattedFileType = 'jpg'
+ break
+ case fileType.includes('png'):
+ formattedFileType = 'png'
+ break
+ case fileType.includes('audio'):
+ formattedFileType = 'mp3'
+ break
+ case fileType.includes('pdf'):
+ formattedFileType = 'pdf'
+ break
+ case fileType.includes('epub'):
+ formattedFileType = 'epub'
+ break
+ default:
+ formattedFileType = ''
+ break
+ }
+ }
+ return formattedFileType
+ }
}
diff --git a/locales/en.json b/locales/en.json
index 0c52a231..bb6cac3d 100644
--- a/locales/en.json
+++ b/locales/en.json
@@ -210,12 +210,14 @@
"IscnRegisterForm.label.emptyFile": "No Content",
"IscnRegisterForm.label.fingerprints": "Content Fingerprints",
"IscnRegisterForm.label.iscn": "ISCN Title",
+ "IscnRegisterForm.label.isbn": "ISBN",
"IscnRegisterForm.label.license": "License",
"IscnRegisterForm.label.likerID": "LikerID",
"IscnRegisterForm.label.sameAs" : "Same As URLs",
"IscnRegisterForm.label.name": "Name",
"IscnRegisterForm.label.fileName": "File name",
"IscnRegisterForm.label.fileType": "File type",
+ "IscnRegisterForm.label.originFile": "origin file: {name}",
"IscnRegisterForm.label.numbersProtocol": "Numbers Protocol",
"IscnRegisterForm.label.numbersProtocol.details": "Register your image asset in {link}",
"IscnRegisterForm.label.numbersProtocol.details.link": "Numbers Protocol",
@@ -234,6 +236,7 @@
"IscnRegisterForm.placeholder.fileName": "File Name (en)",
"IscnRegisterForm.placeholder.fileType": "File Type",
"IscnRegisterForm.placeholder.url": "URL",
+ "IscnRegisterForm.placeholder.isbn": "ISBN 10/ ISCN 13",
"IscnRegisterForm.placeholder.wallet": "Wallet Address",
"IscnRegisterForm.quitAlertDialog.confirm": "Cancel Registration",
"IscnRegisterForm.quitAlertDialog.content": "Your registration will be cancelled if you leave this page, and the paid fee cannot be refunded.",
diff --git a/utils/cosmos/iscn/iscn.type.ts b/utils/cosmos/iscn/iscn.type.ts
index 377bdffa..8f36b25b 100644
--- a/utils/cosmos/iscn/iscn.type.ts
+++ b/utils/cosmos/iscn/iscn.type.ts
@@ -25,7 +25,8 @@ export interface ISCNRegisterPayload {
recordNotes?: string;
memo?: string;
inLanguage?: string;
- thumbnail?: any;
+ thumbnailUrl?: string;
+ isbn?: string | number;
}
export interface ISCNRecordWithID extends ISCNRecord {
id: string;