fix: mscz file ref
This commit is contained in:
parent
7705320ce9
commit
e10b975eeb
1 changed files with 7 additions and 1 deletions
|
@ -14,6 +14,7 @@ export const ugappJsStore: Record<string, any> | null = (() => {
|
|||
})()
|
||||
|
||||
const IPNS_KEY = 'QmSdXtvzC8v8iTTZuj5cVmiugnzbR1QATYRcGix4bBsioP'
|
||||
const RADIX = 20
|
||||
|
||||
export const scoreinfo = {
|
||||
|
||||
|
@ -32,6 +33,11 @@ export const scoreinfo = {
|
|||
}
|
||||
},
|
||||
|
||||
get idLastDigit (this: typeof scoreinfo): number {
|
||||
const idStr = (+this.id).toString(RADIX)
|
||||
return parseInt(idStr[idStr.length - 1], RADIX)
|
||||
},
|
||||
|
||||
get title (this: typeof scoreinfo): string {
|
||||
try {
|
||||
return this.playerdata.title
|
||||
|
@ -68,7 +74,7 @@ export const scoreinfo = {
|
|||
},
|
||||
|
||||
get msczIpfsRef (this: typeof scoreinfo): string {
|
||||
return `/ipns/${IPNS_KEY}/${this.id}.mscz`
|
||||
return `/ipns/${IPNS_KEY}/${this.idLastDigit}/${this.id}.mscz`
|
||||
},
|
||||
|
||||
get msczCidUrl (this: typeof scoreinfo): string {
|
||||
|
|
Loading…
Reference in a new issue