Skip to content

Commit

Permalink
feat(anni): allow to configure musicbrainz base url
Browse files Browse the repository at this point in the history
  • Loading branch information
Yesterday17 committed Apr 20, 2024
1 parent 1e0d624 commit 20ab0f9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion anni/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ anyhow.workspace = true
cuna = "0.7.0"
id3 = "1"
anni-vgmdb = "0.3.1"
musicbrainz_rs = { version = "0.5.0", default-features = false, features = [
musicbrainz_rs = { git = "https://github.com/ProjectAnni/musicbrainz_rs.git", default-features = false, features = [
"rustls",
"async",
] }
Expand Down
9 changes: 9 additions & 0 deletions anni/src/subcommands/repo/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,13 @@ async fn repo_get_cue(

#[derive(Args, Debug, Clone)]
pub struct RepoGetMusicbrainz {
#[clap(
env = "MUSICBRAINZ_BASE_URL",
default_value = "https://musicbrainz.org/ws/2"
)]
#[clap(long)]
base_url: String,

#[clap(long)]
id: String,
catalog: String,
Expand All @@ -201,6 +208,8 @@ async fn repo_get_musicbrainz(
manager: &RepositoryManager,
get: &RepoGetAction,
) -> anyhow::Result<()> {
musicbrainz_rs::config::set_base_url(options.base_url);

let release = Release::fetch()
.id(&options.id)
.with_release_groups()
Expand Down

0 comments on commit 20ab0f9

Please sign in to comment.