Skip to content

Commit

Permalink
Merge branch 'master' into beta
Browse files Browse the repository at this point in the history
* master:
  Update POT files using the production database
  Update translations from Transifex
  Link to input clean album URL from error message
  Return error message only when an error occurred
  Drop unneeded space and key attribute
  Quote URL patterns that should not be localized
  Typo: Add missing full stop to error message
  Fix error message for Instagram’s explore links
  Use bracketedText to reuse localizable message
  MBS-10849: Check for allowNew on AddReleaseGroup (#1530)
  MBS-10850: Update BadAmazonURLs report to avoid false positives (#1534)
  MBS-10863: Use new_barcode instead of undef barcode (#1535)
  MBS-8412: Standardize pagination limits (#1467)
  MBS-10855: Show [removed] recording in historic EditTrack (#1532)
  MBS-10613: Only show git info on staging servers (#1510)
  MBS-10853: Include link to subbed users' open edits in sub email (#1533)
  MBS-10727: Drop kasi-time.com from lyrics whitelist (#1537)
  MBS-10732: Add collaborator validation to collection form (#1496)
  Reference MB Solr and SIR in install doc
  MBH-502: SOLR access via search.mb.org/ws/2
  MBS-10789: Add validation for Genius links
  MBS-9963: Update Genius logo
  MBS-9963: Update Genius link format
  Do not sleep after updating the last host
  Fix defining alert cache keys for the beta website
  Restore distinguishing banner for the beta website
  Sleep 60 seconds more when deploying beta
  • Loading branch information
yvanzo committed May 28, 2020
2 parents 6aa38a5 + 7552b3d commit 2258740
Show file tree
Hide file tree
Showing 40 changed files with 5,181 additions and 3,629 deletions.
3 changes: 2 additions & 1 deletion INSTALL.md
Expand Up @@ -345,7 +345,8 @@ The server by itself doesn't rate limit any request it handles. If you're
receiving 503s, then you're likely performing
[search queries](https://musicbrainz.org/doc/Search_Server) without having set
up a local instance of the
[search server](https://github.com/metabrainz/search-server). By default,
[search server](https://github.com/metabrainz/mb-solr) along with the
[search index rebuilder](https://github.com/metabrainz/sir). By default,
search queries are sent to search.musicbrainz.org and are rate limited.

Once you set up your own instance, change `SEARCH_SERVER` in lib/DBDefs.pm to
Expand Down
2 changes: 1 addition & 1 deletion lib/DBDefs.pm.sample
Expand Up @@ -170,7 +170,7 @@ sub WEB_SERVER { "www.musicbrainz.example.com" }
# Relevant only if SSL redirects are enabled
# sub WEB_SERVER_SSL { "localhost" }
# sub SEARCH_SERVER { "search.musicbrainz.org" }
# sub SEARCH_ENGINE { "LUCENE" }
# sub SEARCH_ENGINE { "SOLR" }
# Used, for example, to have emails sent from the beta server list the
# main server
# sub WEB_SERVER_USED_IN_EMAIL { my $self = shift; $self->WEB_SERVER }
Expand Down
2 changes: 1 addition & 1 deletion lib/DBDefs/Default.pm
Expand Up @@ -103,7 +103,7 @@ sub WEB_SERVER { "localhost:5000" }
# Relevant only if SSL redirects are enabled
sub WEB_SERVER_SSL { "localhost" }
sub SEARCH_SERVER { "search.musicbrainz.org" }
sub SEARCH_ENGINE { "LUCENE" }
sub SEARCH_ENGINE { "SOLR" }
# Whether to use x-accel-redirect for webservice searches,
# using /internal/search as the internal redirect
sub SEARCH_X_ACCEL_REDIRECT { 0 }
Expand Down
4 changes: 0 additions & 4 deletions lib/MusicBrainz/Server/Controller/Edit.pm
Expand Up @@ -23,10 +23,6 @@ with 'MusicBrainz::Server::Controller::Role::Load' => {
entity_name => 'edit',
};

__PACKAGE__->config(
paging_limit => 25,
);

=head1 NAME
MusicBrainz::Server::Controller::Moderation - handle user interaction
Expand Down
4 changes: 0 additions & 4 deletions lib/MusicBrainz/Server/Controller/User.pm
Expand Up @@ -34,10 +34,6 @@ with 'MusicBrainz::Server::Controller::Role::Load' => {
model => 'Editor'
};

__PACKAGE__->config(
paging_limit => 25,
);

use Try::Tiny;

=head1 NAME
Expand Down
4 changes: 0 additions & 4 deletions lib/MusicBrainz/Server/Controller/User/Edits.pm
Expand Up @@ -6,10 +6,6 @@ BEGIN { extends 'MusicBrainz::Server::Controller' };
use MusicBrainz::Server::Data::Utils qw( load_everything_for_edits );
use MusicBrainz::Server::Constants ':edit_status';

__PACKAGE__->config(
paging_limit => 25,
);

sub _edits {
my ($self, $c, $loader) = @_;

Expand Down
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Server/Data/Search.pm
Expand Up @@ -794,7 +794,7 @@ sub external_search
$type =~ s/release_group/release-group/;

my $search_url_string;
if (DBDefs->SEARCH_ENGINE eq 'LUCENE') {
if (DBDefs->SEARCH_ENGINE eq 'LUCENE' || DBDefs->SEARCH_SERVER eq DBDefs::Default->SEARCH_SERVER) {
my $dismax = $adv ? 'false' : 'true';
$search_url_string = "http://%s/ws/2/%s/?query=%s&offset=%s&max=%s&fmt=jsonnew&dismax=$dismax&web=1";
} else {
Expand Down
1 change: 0 additions & 1 deletion lib/MusicBrainz/Server/Data/URL.pm
Expand Up @@ -88,7 +88,6 @@ my %URL_SPECIALIZATIONS = (
'Joysound' => qr{^https?://(?:www\.)?joysound\.com/}i,
'JunoDownload' => qr{^https?://(?:www\.)?junodownload\.com/}i,
'Kashinavi' => qr{^https?://(?:www\.)?kashinavi\.com/}i,
'KasiTime' => qr{^https?://(?:www\.)?kasi-time\.com/}i,
'Kget' => qr{^https?://(?:www\.)?kget\.jp/}i,
'Kickstarter' => qr{^https?://(?:www\.)?kickstarter\.com/}i,
'Kofi' => qr{^https?://(?:www\.)?ko-fi\.com/}i,
Expand Down
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Server/Data/WebService.pm
Expand Up @@ -211,7 +211,7 @@ sub xml_search
}

my $url_ext;
if (DBDefs->SEARCH_ENGINE eq 'LUCENE') {
if (DBDefs->SEARCH_ENGINE eq 'LUCENE' || DBDefs->SEARCH_SERVER eq DBDefs::Default->SEARCH_SERVER) {
my $format = ($args->{fmt} // "") eq "json" ? "jsonnew" : "xml";
$url_ext = "/ws/2/$resource/?" .
"max=$limit&type=$resource&fmt=$format&offset=$offset" .
Expand Down
6 changes: 5 additions & 1 deletion lib/MusicBrainz/Server/Edit/Historic/ChangeTrackArtist.pm
Expand Up @@ -8,6 +8,7 @@ use MusicBrainz::Server::Translation qw( N_l );
use MusicBrainz::Server::Edit::Historic::Base;

use aliased 'MusicBrainz::Server::Entity::Artist';
use aliased 'MusicBrainz::Server::Entity::Recording';

sub edit_name { N_l('Edit track (historic)') }
sub edit_kind { 'edit' }
Expand Down Expand Up @@ -36,7 +37,10 @@ sub build_display_data
{
my ($self, $loaded) = @_;
return {
recording => $loaded->{Recording}->{ $self->data->{recording_id} },
recording => $loaded->{Recording}->{ $self->data->{recording_id} } ||
Recording->new(
id => $self->data->{recording_id},
),
artist => {
old => $loaded->{Artist}->{ $self->data->{old_artist_id} } ||
Artist->new(
Expand Down
3 changes: 3 additions & 0 deletions lib/MusicBrainz/Server/Email/Subscriptions.pm
Expand Up @@ -105,6 +105,9 @@ To view or edit your subscription list, please use the following link:
To see all open edits for your subscribed entities, see this link:
[% self.server %]/edit/subscribed?open=1
To see all open edits by your subscribed editors, see this link:
[% self.server %]/edit/subscribed_editors?open=1
};
}

Expand Down
23 changes: 0 additions & 23 deletions lib/MusicBrainz/Server/Entity/URL/KasiTime.pm

This file was deleted.

28 changes: 28 additions & 0 deletions lib/MusicBrainz/Server/Form/Collection.pm
Expand Up @@ -78,4 +78,32 @@ sub validate_type_id {
}
}

sub validate_collaborators {
my $self = shift;

my @collaborators = $self->field('collaborators')->fields;
my $is_valid = 1;
for my $collaborator (@collaborators) {
my $id_field = $collaborator->field('id');
my $name_field = $collaborator->field('name');
if (defined $name_field->value && !(defined $id_field->value)) {
my $editor = $self->ctx->model('Editor')->get_by_name($name_field->value);
if (defined $editor) {
$id_field->add_error(
l('To add “{editor}” as a collaborator, please select them from the dropdown.',
{editor => $name_field->value})
);
} else {
$id_field->add_error(
l('Editor “{editor}” does not exist.',
{editor => $name_field->value})
);
}
$is_valid = 0;
}
}

return $is_valid;
}

1;
3 changes: 2 additions & 1 deletion lib/MusicBrainz/Server/Report/BadAmazonURLs.pm
Expand Up @@ -20,7 +20,8 @@ sub query
JOIN release r ON lru.entity0 = r.id
WHERE
url ~ 'amazon\.' AND
url !~ '^https?://www\.amazon\.(com|ca|cn|de|es|fr|it|co\.(jp|uk)|in|com\.(br|mx))/gp/product/[0-9A-Z]{10}$'
url !~ '^https?://www\.amazon\.(com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)/gp/product/[0-9A-Z]{10}$' AND
url !~ '^https?://music\.amazon\.(com|ca|co\.uk|fr|ae|at|de|it|sg|co\.jp|jp|cn|es|in|nl|com\.br|com\.mx|com\.au|com\.tr)'
};
}

Expand Down
4 changes: 2 additions & 2 deletions po/attributes.de.po
Expand Up @@ -15,8 +15,8 @@
# Frank Matthiae <email address hidden>, 2015
# Hans-Peter Braun <email address hidden>, 2017
# happykraut, 2017
# J L <email address hidden>, 2018
# J L <email address hidden>, 2018
# 871cf62ea721ffc486279ce0e5a0f34c_d3e66b3 <email address hidden>, 2018
# 871cf62ea721ffc486279ce0e5a0f34c_d3e66b3 <email address hidden>, 2018
# Jod isnotmyname <email address hidden>, 2017
# happykraut, 2017
# Leo_Verto <email address hidden>, 2017
Expand Down

0 comments on commit 2258740

Please sign in to comment.