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
  MBS-12308: Clarify the missing artist errors
  MBS-13042: Increase default font size (12 -> 14px)
  MBS-12743: Convert Delete area page to React
  Make $can_delete reusable
  MBS-12851: Hide ratings/tags stats for deleted users (#2810)
  MBS-12740: Convert Delete attribute page to React (#2771)
  MBS-13041: Fix broken Utaten favicon (#2921)
  Make button use the standard font size
  Use named variables for font size over rem
  MBS-12749: Convert cdtoc/attach_filter_artist to React
  Better formatting for InlineSubmitButton
  MBS-12309: Clarify /edit/subscribed also includes collection edits (#2489)
  Specified the OS requirements (#2915)
  MBS-10861: Standardize time before auto-deletion to 48 hours (#2638)
  Add missing space
  MBS-12782: Block adding CritiqueBrainz links
  • Loading branch information
reosarevok committed Apr 25, 2023
2 parents c9d11fe + 62d1fd0 commit db32c3b
Show file tree
Hide file tree
Showing 38 changed files with 799 additions and 469 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Full installation instructions are available in [INSTALL.md](INSTALL.md).

General Prerequisites:

* Ubuntu/Debian
* Ubuntu/Debian (or some other Unix-like operating system at your own risks)
* Node (at least version 16)
* Perl (at least version 5.30)
* PostgreSQL (at least version 12)
Expand Down
2 changes: 1 addition & 1 deletion lib/MusicBrainz/Script/RemoveEmpty.pm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ sub run {
"SELECT id
FROM $entity T
WHERE edits_pending = 0
AND (last_updated < now() - '1 day'::interval OR last_updated IS NULL)
AND (last_updated < now() - '2 day'::interval OR last_updated IS NULL)
AND NOT (
EXISTS (
SELECT 1
Expand Down
8 changes: 4 additions & 4 deletions lib/MusicBrainz/Script/RemoveUnreferencedRows.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ use Moose;
=head1 DESCRIPTION
This script process the rows of the table 'unreferenced_row_log' that have been
inserted more than 7 days ago.
inserted more than 2 days ago.
This table weakly references rows (of other tables) that have been temporarily
unreferenced but might be referenced again by an edit, hence the 7 days delay.
unreferenced but might be referenced again by an edit, hence the 2 days delay.
When processing an 'unreferenced_row_log' row, the script removes the weakly
referenced row if it is still unreferenced by checking 'ref_count', and removes
Expand Down Expand Up @@ -51,7 +51,7 @@ sub run {
SELECT table_name,
array_agg(row_id) AS row_ids
FROM unreferenced_row_log
WHERE inserted < now() - '7 day'::interval
WHERE inserted < now() - '2 day'::interval
GROUP BY table_name
SQL
};
Expand All @@ -67,7 +67,7 @@ sub run {
my $removed = 0;

log_info {
sprintf 'Found %d %s row%s unreferenced for 7 or more days.',
sprintf 'Found %d %s row%s unreferenced for 2 or more days.',
$count, $table_name, ($count==1 ? '' : 's');
};

Expand Down
20 changes: 17 additions & 3 deletions lib/MusicBrainz/Server/Controller/Admin/Attributes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,24 @@ sub delete : Chained('attribute_base') Args(1) RequireAuth(account_admin) Secure

$c->detach;
}

$c->stash(
component_path => 'admin/attributes/DeleteAttribute',
component_props => {
attribute => $attr->TO_JSON,
form => $form->TO_JSON,
},
current_view => 'Node',
);

if ($c->form_posted_and_valid($form)) {
$c->model('MB')->with_transaction(sub {
$c->model($model)->delete($id);
});
if ($form->field('cancel')->input) {
# Do nothing
} else {
$c->model('MB')->with_transaction(sub {
$c->model($model)->delete($id);
});
}

$c->response->redirect($c->uri_for('/admin/attributes', $model));
$c->detach;
Expand Down
14 changes: 12 additions & 2 deletions lib/MusicBrainz/Server/Controller/CDTOC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ use MusicBrainz::Server::Constants qw(
$EDIT_SET_TRACK_LENGTHS
);
use MusicBrainz::Server::Entity::CDTOC;
use MusicBrainz::Server::Entity::Util::JSON qw( to_json_array );
use MusicBrainz::Server::Translation qw( l );
use MusicBrainz::Server::ControllerUtils::CDTOC qw( add_dash );
use MusicBrainz::Server::ControllerUtils::JSON qw( serialize_pager );
use MusicBrainz::Server::Validation qw(
is_database_row_id
);
Expand Down Expand Up @@ -311,9 +313,17 @@ sub _attach_list {
my $artists = $self->_load_paged($c, sub {
$c->model('Search')->search('artist', $search_artist->field('query')->value, shift, shift)
});
my %props = (
form => $search_artist->TO_JSON,
cdToc => $cdtoc->TO_JSON,
pager => serialize_pager($c->stash->{pager}),
results => to_json_array($artists),
tocString => $c->stash->{toc},
);
$c->stash(
template => 'cdtoc/attach_filter_artist.tt',
artists => $artists
current_view => 'Node',
component_path => 'cdtoc/SelectArtistForCDToc.js',
component_props => \%props,
);
$c->detach;
}
Expand Down
29 changes: 20 additions & 9 deletions lib/MusicBrainz/Server/Controller/Role/Delete.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package MusicBrainz::Server::Controller::Role::Delete;
use MooseX::MethodAttributes::Role;
use MooseX::Role::Parameterized;
use MusicBrainz::Server::ControllerUtils::Delete qw( cancel_or_action );
use MusicBrainz::Server::Data::Utils qw( model_to_type );
use MusicBrainz::Server::Data::Utils qw( boolean_to_json model_to_type );

parameter 'edit_type' => (
isa => 'Int',
Expand Down Expand Up @@ -40,22 +40,33 @@ role {
my $entity_name = $self->{entity_name};
my $edit_entity = $c->stash->{ $entity_name };
my $model = $self->{model};
if ($model eq 'Area') {
$c->stash(
is_release_country_area => $c->model('Area')->is_release_country_area($edit_entity->id)
);
}
my $can_delete = $c->model($model)->can_delete($edit_entity->id);

if ($model eq 'Genre' || $model eq 'Release') {
if ($model eq 'Area' || $model eq 'Genre' || $model eq 'Release') {
my $type = model_to_type($model);

my %props = (
entity => $edit_entity->TO_JSON,
);

if ($model eq 'Area') {
$props{canDelete} = boolean_to_json($can_delete);

$props{isReleaseCountry} = boolean_to_json(
$c->model('Area')->is_release_country_area(
$edit_entity->id,
),
);
}

$c->stash(
component_path => $type . '/Delete' . $model,
component_props => {entity => $edit_entity->TO_JSON},
component_props => \%props,
current_view => 'Node',
);
}

if ($c->model($model)->can_delete($edit_entity->id)) {
if ($can_delete) {
$c->stash( can_delete => 1 );
# find a corresponding add edit and cancel instead, if applicable (MBS-1397)
my $create_edit_type = $self->{create_edit_type};
Expand Down
30 changes: 15 additions & 15 deletions po/attributes.fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ msgid ""
"by the artist and/or their record company after being released, whether to "
"replace it with a new version with some changes or to just retire it "
"altogether (e.g. because of legal issues)."
msgstr ""
msgstr "Une parution précédemment officielle qui a été activement retirée de la circulation par l’artiste ou la maison de disques après sa parution, qu’elle soit remplacée par une nouvelle version avec des changements ou qu’elle soit simplement retirée (par exemple pour des problèmes de droit)."

#: DB:release_group_secondary_type/description:10
msgctxt "release_group_secondary_type"
Expand Down Expand Up @@ -1127,12 +1127,12 @@ msgstr "Automatique"
#: DB:event_type/name:7
msgctxt "event_type"
msgid "Award ceremony"
msgstr ""
msgstr "Cérémonie de remise de prix"

#: DB:series_type/name:15
msgctxt "series_type"
msgid "Award ceremony"
msgstr ""
msgstr "Cérémonie de remise de prix"

#: DB:work_attribute_type_allowed_value/value:694
msgctxt "work_attribute_type_allowed_value"
Expand Down Expand Up @@ -1610,7 +1610,7 @@ msgstr "Production pirate"
#: DB:cover_art_archive.art_type/name:49
msgctxt "cover_art_type"
msgid "Bottom"
msgstr ""
msgstr "Bas"

#: DB:release_packaging/name:19
msgctxt "release_packaging"
Expand Down Expand Up @@ -2953,7 +2953,7 @@ msgstr "ID GEMA"
#: DB:work_attribute_type/name:106
msgctxt "work_attribute_type"
msgid "GMR ID"
msgstr ""
msgstr "ID GMR"

#: DB:work_attribute_type_allowed_value/value:88
msgctxt "work_attribute_type_allowed_value"
Expand Down Expand Up @@ -3784,7 +3784,7 @@ msgstr "ID pour la COMPASS, société singapourienne de gestion des droits"
#: DB:work_attribute_type/description:140
msgctxt "work_attribute_type"
msgid "ID for the Slovenian rights society SAZAS"
msgstr ""
msgstr "ID pour la SAZAS, société slovène de gestion des droits"

#: DB:work_attribute_type/description:68
msgctxt "work_attribute_type"
Expand Down Expand Up @@ -3834,7 +3834,7 @@ msgstr "ID pour la BMI, société états-unienne de gestion des droits"
#: DB:work_attribute_type/description:106
msgctxt "work_attribute_type"
msgid "ID for the US rights society GMR"
msgstr ""
msgstr "ID pour la GMR, société états-unienne de gestion des droits"

#: DB:work_attribute_type/description:8
msgctxt "work_attribute_type"
Expand All @@ -3854,7 +3854,7 @@ msgstr "ID pour la SACVEN, société vénézuélienne de gestion des droits"
#: DB:work_attribute_type/description:107
msgctxt "work_attribute_type"
msgid "ID for the Vietnamese rights society VCPMC"
msgstr ""
msgstr "ID pour la VCPMC, société vietnamienne de gestion des droits"

#: DB:work_attribute_type/description:38
msgctxt "work_attribute_type"
Expand Down Expand Up @@ -6129,7 +6129,7 @@ msgstr "Brute / Non-modifiée"
#: DB:series_type/name:48
msgctxt "series_type"
msgid "Recording award"
msgstr ""
msgstr "Récompense d’enregistrement"

#: DB:editor_collection_type/name:12
msgctxt "collection_type"
Expand Down Expand Up @@ -6174,7 +6174,7 @@ msgstr "Collection de parutions"
#: DB:series_type/name:47
msgctxt "series_type"
msgid "Release group award"
msgstr ""
msgstr "Récompense de groupe de parution"

#: DB:editor_collection_type/name:13
msgctxt "collection_type"
Expand Down Expand Up @@ -6420,7 +6420,7 @@ msgstr "SAYCO ID"
#: DB:work_attribute_type/name:140
msgctxt "work_attribute_type"
msgid "SAZAS ID"
msgstr ""
msgstr "ID SAZAS"

#: DB:medium_format/name:62
msgctxt "medium_format"
Expand Down Expand Up @@ -7447,7 +7447,7 @@ msgstr "Tishra-jâti êka"
#: DB:cover_art_archive.art_type/name:48
msgctxt "cover_art_type"
msgid "Top"
msgstr ""
msgstr "Haut"

#: DB:series_type/name:7
msgctxt "series_type"
Expand Down Expand Up @@ -7604,7 +7604,7 @@ msgstr "VCD"
#: DB:work_attribute_type/name:107
msgctxt "work_attribute_type"
msgid "VCPMC ID"
msgstr ""
msgstr "ID VCPMC"

#: DB:medium_format/name:59
msgctxt "medium_format"
Expand Down Expand Up @@ -7787,12 +7787,12 @@ msgstr "Liste de souhaits"
#: DB:release_status/name:5
msgctxt "release_status"
msgid "Withdrawn"
msgstr ""
msgstr "Retirée"

#: DB:series_type/name:46
msgctxt "series_type"
msgid "Work award"
msgstr ""
msgstr "Récompense d’œuvre"

#: DB:editor_collection_type/name:15
msgctxt "collection_type"
Expand Down
17 changes: 15 additions & 2 deletions po/instrument_descriptions.pot
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,14 @@ msgid ""
"secondary and one drone string."
msgstr ""

#. name:washtub bass
#: DB:instrument/description:96
msgid ""
"Consisting of a stick, a string and an resonator of various materials, it is "
"used in many countries' low-cost and DIY cultures. It's technically a "
"variable tension chordophone."
msgstr ""

#. name:bonang
#: DB:instrument/description:969
msgid ""
Expand Down Expand Up @@ -948,8 +956,8 @@ msgstr ""
#. name:biniou
#: DB:instrument/description:1117
msgid ""
"Developed from the veuze and often accompanied with the bombard, the small "
"high-pitched, singular octave bagpipe is used in Breton folk dancing."
"Developed from the veuze and often accompanying the bombard, the small high-"
"pitched, singular octave bagpipe is used in Breton folk dancing."
msgstr ""

#. name:pedal accordion
Expand Down Expand Up @@ -4556,6 +4564,11 @@ msgid ""
"neck and thinner ribs than the cello."
msgstr ""

#. name:triangle
#: DB:instrument/description:106
msgid "Tuned metal bar, bent into triangle shape."
msgstr ""

#. name:alto violin
#: DB:instrument/description:174
msgid ""
Expand Down
3 changes: 2 additions & 1 deletion po/instruments.pot
Original file line number Diff line number Diff line change
Expand Up @@ -3990,7 +3990,7 @@ msgid "tres"
msgstr ""

#: DB:instrument/name:106
msgctxt "Tuned metal bar, bent into triangle shape"
msgctxt "Tuned metal shape"
msgid "triangle"
msgstr ""

Expand Down Expand Up @@ -4295,6 +4295,7 @@ msgid "washboard"
msgstr ""

#: DB:instrument/name:96
msgctxt "Improvised monochord"
msgid "washtub bass"
msgstr ""

Expand Down

0 comments on commit db32c3b

Please sign in to comment.