Skip to content

Commit

Permalink
Merge pull request #34 from N3aar/feat/user-agent-musicbrainz
Browse files Browse the repository at this point in the history
feat: add user-agent to musicbrainz requests
  • Loading branch information
Psykka authored Jun 23, 2024
2 parents 15035dd + 3e0dc13 commit 4387865
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 0 additions & 3 deletions src/commands/lastfm/jbleaderboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,6 @@ export class JBLeaderboardCommand extends Command {
const fieldTitle = fieldTitles[type];
const fieldValue = fieldValues[type];

console.log(type);
console.log(fieldTitle);

const values = leaderboard.map((stats) => `${stats[type]} ${fieldValue}`);
const users = leaderboard.map((stats, index) => {
return `${leaderboardEmojis[index] ?? `${index + 1}.`} <@${
Expand Down
6 changes: 5 additions & 1 deletion src/shared/integrations/musicBrainzAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ import type { ArtistData } from "../types/musicBrainzTypes.js";

export default class MusicBrainzAPI extends BaseRequest {
constructor() {
super("https://musicbrainz.org/ws/2", {});
super("https://musicbrainz.org/ws/2", {
headers: {
"User-Agent": "EeryProject/1.0 (eery-project@outlook.com)",
},
});
}

public async searchArtist(artistName: string): Promise<ArtistData | null> {
Expand Down

0 comments on commit 4387865

Please sign in to comment.