Skip to content

Commit

Permalink
Fix for bfaist#9 and bfaist#10 on official repo
Browse files Browse the repository at this point in the history
  • Loading branch information
davehayes committed Mar 21, 2022
1 parent 2f1574d commit 2ccb0e2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/WebService/MusicBrainz.pm
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ has search_fields_by_resource => sub {
$search_fields{artist} = [
'area', 'beginarea', 'endarea', 'arid', 'artist', 'artistaccent',
'alias', 'begin', 'comment', 'country', 'end', 'ended',
'gender', 'ipi', 'sortname', 'tag', 'type'
'gender', 'ipi', 'sortname', 'status', 'tag', 'type'
];
$search_fields{discid} = ['discid'];
$search_fields{label} = [
Expand Down
10 changes: 9 additions & 1 deletion lib/WebService/MusicBrainz/Request.pm
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ our $VERSION = '1.0';

binmode STDOUT, ":encoding(UTF-8)";

my @not_in_query = (qw(
status type
));

sub make_url {
my $self = shift;

Expand All @@ -48,7 +52,7 @@ sub make_url {

$url_str .= '?fmt=' . $self->format;

if(scalar(@{ $self->inc }) > 0) {
if(scalar(@{ $self->inc }) > 0) {
my $inc_query = join '+', @{ $self->inc };

$url_str .= '&inc=' . $inc_query;
Expand All @@ -57,7 +61,11 @@ sub make_url {
my @extra_params;

foreach my $key (keys %{ $self->query_params }) {
if (grep($_ eq $key, @not_in_query) > 0) {
$url_str .= '&' . $key . '=' . $self->query_params->{$key};
} else {
push @extra_params, $key . ':"' . $self->query_params->{$key} . '"';
}
}

if(scalar(@extra_params) > 0) {
Expand Down

0 comments on commit 2ccb0e2

Please sign in to comment.