Skip to content

Commit

Permalink
feat: add implementation for missing ddo metadata attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
moritzkirstein committed Jul 14, 2023
1 parent 16b4edd commit a0f2e0b
Showing 1 changed file with 35 additions and 6 deletions.
41 changes: 35 additions & 6 deletions src/Nautilus/Asset/AssetBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
MetadataConfig,
NftCreateDataWithoutOwner
} from '../../@types/Publish'
import { combineArrays, removeDuplicatesFromArray } from '../../utils'
import { NautilusAsset, PricingConfigWithoutOwner } from './NautilusAsset'
import {
FileTypes,
Expand Down Expand Up @@ -103,12 +104,40 @@ export class AssetBuilder implements IAssetBuilder {
return this
}

// TODO: implement
setCopyrightHolder: (copyrightHolder: string) => IAssetBuilder
addTags: (tags: string[]) => IAssetBuilder
addLinks: (links: string[]) => IAssetBuilder
setContentLanguage: (language: string) => IAssetBuilder
addCategories: (categories: string[]) => IAssetBuilder
setCopyrightHolder(copyrightHolder: string) {
this.asset.metadata.copyrightHolder = copyrightHolder

return this
}

addTags(tags: string[]) {
this.asset.metadata.tags = combineArrays(this.asset.metadata.tags, tags)

return this
}

addLinks(links: string[]) {
this.asset.metadata.links = combineArrays(this.asset.metadata.links, links)

return this
}

// TODO: add check for correct language tag
// https://www.rfc-editor.org/info/bcp47
setContentLanguage(language: string) {
this.asset.metadata.contentLanguage = language

return this
}

addCategories(categories: string[]) {
this.asset.metadata.categories = combineArrays(
this.asset.metadata.categories,
categories
)

return this
}

build() {
// TODO: look for errors / missing input
Expand Down

0 comments on commit a0f2e0b

Please sign in to comment.