Skip to content

Adding MusicBrainz as a metadata source #361

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.245.2/containers/docker-existing-dockerfile
{
"name": "Existing Dockerfile",

// Sets the run context to one level up instead of the .devcontainer folder.
"context": "..",

// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerFile": "../Dockerfile"

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Uncomment the next line to run commands after the container is created - for example installing curl.
// "postCreateCommand": "apt-get update && apt-get install -y curl",

// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
// "runArgs": [ "--cap-add=SYS_PTRACE", "--security-opt", "seccomp=unconfined" ],

// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],

// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
// "remoteUser": "vscode"
}
48 changes: 48 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Short Query (Spotify)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [ "spotify:artist:6M2wZ9GZgrQXHCFfjv46we" ]
},
{
"type": "node",
"request": "launch",
"name": "Short Query (MusicBrainz)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [ "mb:release:be580d1c-181f-4ad9-9bfd-172c3960979e" ]
},
{
"type": "node",
"request": "launch",
"name": "Short Query (Deezer)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [ "deezer:artist:182" ]
},
{
"type": "node",
"request": "launch",
"name": "URI Query (Apple Music)",
"skipFiles": [
"<node_internals>/**"
],
"program": "${workspaceFolder}/cli.js",
"args": [ "https://music.apple.com/us/artist/red-hot-chili-peppers/889780" ]
}
]
}
4 changes: 2 additions & 2 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1546,9 +1546,9 @@ async function init(packageJson, queries, options) {
const contentType = service.identifyType(query);
queryLogger.log(`Detected [${contentType}]`);
let queryStats = await pFlatten(
(contentType === 'track'
(contentType === 'track' || contentType === 'recording'
? trackHandler
: contentType === 'album'
: contentType === 'album' || contentType === 'release-group' || contentType === 'release'
? albumHandler
: contentType === 'artist'
? artistHandler
Expand Down
3 changes: 2 additions & 1 deletion src/freyr.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import {YouTube, YouTubeMusic} from './services/youtube.js';
import Deezer from './services/deezer.js';
import Spotify from './services/spotify.js';
import AppleMusic from './services/apple_music.js';
import MusicBrainz from './services/musicbrainz.js';

export default class FreyrCore {
static ENGINES = [Deezer, Spotify, AppleMusic, YouTube, YouTubeMusic];
static ENGINES = [Deezer, Spotify, AppleMusic, YouTube, YouTubeMusic, MusicBrainz];

static getBitrates() {
return Array.from(
Expand Down
Loading