Skip to content

Commit 1bf3050

Browse files
committed
feat: update librescore link
1 parent ffbac08 commit 1bf3050

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/librescore-link.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ import { assertRes, getFetch } from './utils'
22
import { getMainCid } from './mscz'
33
import { ScoreInfo } from './scoreinfo'
44

5-
const _getLink = (scorepack: string) => {
6-
return `https://librescore.org/score/${scorepack}`
5+
const _getLink = (indexingInfo: string) => {
6+
const { scorepack } = JSON.parse(indexingInfo)
7+
return `https://librescore.org/score/${scorepack as string}`
78
}
89

910
export const getLibreScoreLink = async (scoreinfo: ScoreInfo, _fetch = getFetch()): Promise<string> => {

src/scoreinfo.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { getMainCid } from './mscz'
44

55
export abstract class ScoreInfo {
66
private readonly RADIX = 20;
7-
private readonly INDEX_RADIX = 128;
7+
private readonly INDEX_RADIX = 32;
88

99
abstract id: number;
1010
abstract title: string;
@@ -28,7 +28,7 @@ export abstract class ScoreInfo {
2828
}
2929

3030
public getScorepackRef (mainCid: string): string {
31-
return `/ipfs/${mainCid}/index/${(+this.id) % this.INDEX_RADIX}/${this.id}/scorepack`
31+
return `/ipfs/${mainCid}/index/${(+this.id) % this.INDEX_RADIX}/${this.id}`
3232
}
3333
}
3434

0 commit comments

Comments
 (0)