diff --git a/lib/v2/mymusicsheet/maintainer.js b/lib/v2/mymusicsheet/maintainer.js index a9837cb94..6ff5a7a2b 100644 --- a/lib/v2/mymusicsheet/maintainer.js +++ b/lib/v2/mymusicsheet/maintainer.js @@ -1,3 +1,3 @@ module.exports = { - '/user/sheets/:username/:iso?': ['Freddd13'], + '/user/sheets/:username/:iso?/:freeOnly?': ['Freddd13'], }; diff --git a/lib/v2/mymusicsheet/router.js b/lib/v2/mymusicsheet/router.js index 74a760bcc..5dfbfbae5 100644 --- a/lib/v2/mymusicsheet/router.js +++ b/lib/v2/mymusicsheet/router.js @@ -1,3 +1,3 @@ module.exports = (router) => { - router.get('/user/sheets/:username/:iso?', require('./usersheets')); + router.get('/user/sheets/:username/:iso?/:freeOnly?', require('./usersheets')); }; diff --git a/lib/v2/mymusicsheet/usersheets.js b/lib/v2/mymusicsheet/usersheets.js index ce4ea7e4b..82cb68ea6 100644 --- a/lib/v2/mymusicsheet/usersheets.js +++ b/lib/v2/mymusicsheet/usersheets.js @@ -6,7 +6,7 @@ module.exports = async (ctx) => { const baseUrl = 'https://www.mymusicsheet.com'; const graphqlUrl = 'https://mms.pd.mapia.io/mms/graphql'; const exchangeRateUrl = 'https://payport.pd.mapia.io/v2/currency'; - const { username, iso = 'CNY' } = ctx.params; + const { username, iso = 'CNY', freeOnly } = ctx.params; const exchangeRateResponse = await got(exchangeRateUrl, { searchParams: { @@ -65,7 +65,7 @@ module.exports = async (ctx) => { orderBy: { createdAt: 'DESC', }, - isFree: null, + isFree: Boolean(freeOnly), category: null, artistUrl: username, aggregationKeywords: ['PACKAGE_IDS', 'TAG_IDS', 'INSTRUMENTS', 'SHEET_TYPE', 'INCLUDE_CHORD', 'INCLUDE_LYRICS', 'INSTRUMENTATION', 'LEVEL', 'CATEGORY'], diff --git a/website/docs/routes/shopping.md b/website/docs/routes/shopping.md index 284a0fa6d..298cec57a 100644 --- a/website/docs/routes/shopping.md +++ b/website/docs/routes/shopping.md @@ -272,7 +272,8 @@ Language ### User Sheets {#mymusicsheet-user-sheets} - + + 关于ISO 4217,请参考[维基百科](https://zh.wikipedia.org/zh-cn/ISO_4217#%E7%8E%B0%E8%A1%8C%E4%BB%A3%E7%A0%81)