Skip to content

Commit

Permalink
Merge branch 'master' into feature/modrinth-followers
Browse files Browse the repository at this point in the history
  • Loading branch information
Insprill committed Nov 8, 2022
2 parents f6d8b53 + c214ad8 commit 146191c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 60 deletions.
108 changes: 54 additions & 54 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions services/modrinth/modrinth-downloads.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ export default class ModrinthDownloads extends BaseJsonService {

static route = {
base: 'modrinth/dt',
pattern: ':modId',
pattern: ':projectId',
}

static examples = [
{
title: 'Modrinth Downloads',
namedParams: { modId: 'AANobbMI' },
namedParams: { projectId: 'AANobbMI' },
staticPreview: renderDownloadsBadge({ downloads: 120000 }),
},
]

static defaultBadgeData = { label: 'downloads' }

async fetch({ modId }) {
async fetch({ projectId }) {
return this._requestJson({
schema,
url: `https://api.modrinth.com/api/v1/mod/${modId}`,
url: `https://api.modrinth.com/v2/project/${projectId}`,
})
}

async handle({ modId }) {
const { downloads } = await this.fetch({ modId })
async handle({ projectId }) {
const { downloads } = await this.fetch({ projectId })
return renderDownloadsBadge({ downloads })
}
}

0 comments on commit 146191c

Please sign in to comment.