feat: update librescore link
This commit is contained in:
parent
ffbac084fb
commit
1bf3050513
2 changed files with 5 additions and 4 deletions
|
@ -2,8 +2,9 @@ import { assertRes, getFetch } from './utils'
|
|||
import { getMainCid } from './mscz'
|
||||
import { ScoreInfo } from './scoreinfo'
|
||||
|
||||
const _getLink = (scorepack: string) => {
|
||||
return `https://librescore.org/score/${scorepack}`
|
||||
const _getLink = (indexingInfo: string) => {
|
||||
const { scorepack } = JSON.parse(indexingInfo)
|
||||
return `https://librescore.org/score/${scorepack as string}`
|
||||
}
|
||||
|
||||
export const getLibreScoreLink = async (scoreinfo: ScoreInfo, _fetch = getFetch()): Promise<string> => {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { getMainCid } from './mscz'
|
|||
|
||||
export abstract class ScoreInfo {
|
||||
private readonly RADIX = 20;
|
||||
private readonly INDEX_RADIX = 128;
|
||||
private readonly INDEX_RADIX = 32;
|
||||
|
||||
abstract id: number;
|
||||
abstract title: string;
|
||||
|
@ -28,7 +28,7 @@ export abstract class ScoreInfo {
|
|||
}
|
||||
|
||||
public getScorepackRef (mainCid: string): string {
|
||||
return `/ipfs/${mainCid}/index/${(+this.id) % this.INDEX_RADIX}/${this.id}/scorepack`
|
||||
return `/ipfs/${mainCid}/index/${(+this.id) % this.INDEX_RADIX}/${this.id}`
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue