[mb-commits] branch, data-nes, updated. Correctly consume 'primary-for-locale' when displaying aliases
MusicBrainz Git Server <[email protected]> Fri, 18 Jan 2013 11:06:38 +0000
| Newsgroups | gmane.comp.audio.musicbrainz.cvs |
|---|---|
| Message-ID | <E1Tw9mQ-0000nE-AT@wiley> |
The branch, data-nes has been updated
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=524f96b02aa7c60c87dbf4f7ec31d59474e51950 (commit)
via http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=4a3bcca371e40acdc9d7b7e42ee0c3fced3da57b (commit)
from http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=c9153d25cf38b65f96107e82da2b2e8b63cc2260 (commit)
Summary of changes:
lib/MusicBrainz/Server/Controller/Work.pm | 55 +----------------------------
lib/MusicBrainz/Server/Data/NES/Work.pm | 3 +-
lib/MusicBrainz/Server/Data/Work.pm | 18 ---------
3 files changed, 3 insertions(+), 73 deletions(-)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 524f96b02aa7c60c87dbf4f7ec31d59474e51950
Author: Oliver Charles <[email protected]>
Date: Fri Jan 18 11:03:37 2013 +0000
Correctly consume 'primary-for-locale' when displaying aliases
diff --git a/lib/MusicBrainz/Server/Data/NES/Work.pm b/lib/MusicBrainz/Server/Data/NES/Work.pm
index 924a3d1..14c2b86 100644
--- a/lib/MusicBrainz/Server/Data/NES/Work.pm
+++ b/lib/MusicBrainz/Server/Data/NES/Work.pm
@@ -142,7 +142,8 @@ sub get_aliases {
type_id => $_->{type},
begin_date => MusicBrainz::Server::Entity::PartialDate->new($_->{begin_date}),
end_date => MusicBrainz::Server::Entity::PartialDate->new($_->{end_date}),
- ended => $_->{ended}
+ ended => $_->{ended},
+ primary_for_locale => $_->{'primary-for-locale'}
)
} @$response
]
commit 4a3bcca371e40acdc9d7b7e42ee0c3fced3da57b
Author: Oliver Charles <[email protected]>
Date: Thu Jan 17 08:38:56 2013 +0000
Re-enable work type/language display for tags; remove dead code
diff --git a/lib/MusicBrainz/Server/Controller/Work.pm b/lib/MusicBrainz/Server/Controller/Work.pm
index 86e656e..9a2a193 100644
--- a/lib/MusicBrainz/Server/Controller/Work.pm
+++ b/lib/MusicBrainz/Server/Controller/Work.pm
@@ -4,10 +4,7 @@ use Moose;
BEGIN { extends 'MusicBrainz::Server::Controller'; }
use MusicBrainz::Server::Constants qw(
- $EDIT_WORK_EDIT
$EDIT_WORK_MERGE
- $EDIT_WORK_ADD_ISWCS
- $EDIT_WORK_REMOVE_ISWC
);
use MusicBrainz::Server::Entity::Work;
use MusicBrainz::Server::Entity::Tree::Work;
@@ -65,7 +62,7 @@ sub show : PathPart('') Chained('load')
# NES - originally:
# for my $action (qw( relationships aliases tags details )) {
-for my $action (qw( aliases details )) {
+for my $action (qw( aliases tags details )) {
after $action => sub {
my ($self, $c) = @_;
my $work = $c->stash->{work};
@@ -93,25 +90,6 @@ sub work_tree {
);
}
-# with 'MusicBrainz::Server::Controller::Role::Edit' => {
-# my @current_iswcs = $c->model('ISWC')->find_by_works($work->id);
-# my %current_iswcs = map { $_->iswc => 1 } @current_iswcs;
-# my @submitted = @{ $form->field('iswcs')->value };
-# my %submitted = map { $_ => 1 } @submitted;
-
-# my @added = grep { !exists($current_iswcs{$_}) } @submitted;
-# my @removed = grep { !exists($submitted{$_->iswc}) } @current_iswcs;
-
-# $self->_add_iswcs($c, $form, $work, @added) if @added;
-# $self->_remove_iswcs($c, $form, $work, @removed) if @removed;
-
-# if ((@added || @removed) && $c->stash->{makes_no_changes}) {
-# $c->stash( makes_no_changes => 0 );
-# $c->response->redirect(
-# $c->uri_for_action($self->action_for('show'), [ $work->gid ]));
-# }
-# };
-
with 'MusicBrainz::Server::Controller::Role::Merge' => {
edit_type => $EDIT_WORK_MERGE,
confirmation_template => 'work/merge_confirm.tt',
@@ -156,37 +134,6 @@ sub create : Local Edit {
);
}
-sub _add_iswcs {
- my ($self, $c, $form, $work, @iswcs) = @_;
-
- $c->model('MB')->with_transaction(sub {
- $self->_insert_edit(
- $c, $form,
- edit_type => $EDIT_WORK_ADD_ISWCS,
- iswcs => [ map {
- iswc => $_,
- work => {
- id => $work->id,
- name => $work->name
- }
- }, @iswcs ]
- );
- });
-}
-
-sub _remove_iswcs {
- my ($self, $c, $form, $work, @iswcs) = @_;
-
- $c->model('MB')->with_transaction(sub {
- $self->_insert_edit(
- $c, $form,
- edit_type => $EDIT_WORK_REMOVE_ISWC,
- iswc => $_,
- work => $work
- );
- }) for @iswcs;
-}
-
1;
=head1 COPYRIGHT
diff --git a/lib/MusicBrainz/Server/Data/Work.pm b/lib/MusicBrainz/Server/Data/Work.pm
index 606a59d..b9495a6 100644
--- a/lib/MusicBrainz/Server/Data/Work.pm
+++ b/lib/MusicBrainz/Server/Data/Work.pm
@@ -122,24 +122,6 @@ sub load
load_subobjects($self, 'work', @objs);
}
-sub insert
-{
- my ($self, @works) = @_;
- my %names = $self->find_or_insert_names(map { $_->{name} } @works);
- my $class = $self->_entity_class;
- my @created;
- for my $work (@works)
- {
- my $row = $self->_hash_to_row($work, \%names);
- $row->{gid} = $work->{gid} || generate_gid();
- push @created, $class->new(
- id => $self->sql->insert_row('work', $row, 'id'),
- gid => $row->{gid}
- );
- }
- return @works > 1 ? @created : $created[0];
-}
-
sub update
{
my ($self, $work_id, $update) = @_;
-----------------------------------------------------------------------
hooks/post-receive
--
mb_server