This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[%- MACRO link_entity(entity, action, text) BLOCK; | |
type = "$entity"; | |
IF type.search('Entity::Artist='); link_artist(entity, action, text); | |
ELSIF type.search('Entity::Work='); link_work(entity, action, text); | |
ELSIF type.search('Entity::Label='); link_label(entity, action, text); | |
ELSIF type.search('Entity::Release='); link_release(entity, action, text); | |
ELSIF type.search('Entity::ReleaseGroup='); link_release_group(entity, action, text); | |
END; | |
END -%] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MusicBrainz::Server::Controller::Artist; | |
BEGIN | |
{ | |
use Moose; | |
extends 'MusicBrainz::Server::Controller'; | |
with 'MusicBrainz::Server::Controller::Annotation'; | |
} | |
__PACKAGE__->config( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$c->model('ReleaseStatus')->load($release); | |
$c->model('ReleasePackaging')->load($release); | |
$c->model('Country')->load($release); | |
$c->model('Language')->load($release); | |
$c->model('Script')->load($release); | |
$c->model('ReleaseLabel')->load($release); | |
$c->model('Medium')->load($release); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
musicbrainz_db=# \d artist_name; | |
Table "musicbrainz_test.artist_name" | |
Column | Type | Modifiers | |
----------+------------------------+---------------------------------------------------------- | |
id | integer | not null default nextval('artist_name_id_seq'::regclass) | |
name | character varying(255) | not null | |
page | integer | not null | |
refcount | integer | default 0 | |
Indexes: | |
"artist_name_pk" PRIMARY KEY, btree (id) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub find_or_insert | |
{ | |
my ($self, @artist_joinphrase) = @_; | |
my $i = 0; | |
my ($credits, $join_phrases) = part { $i++ % 2 } @artist_joinphrase; | |
my @positions = (0..scalar @$credits - 1); | |
my @artists = map { $_->{artist} } @$credits; | |
my @names = map { $_->{name} } @$credits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub find_or_insert | |
{ | |
my ($self, @artist_joinphrase) = @_; | |
my $i = 0; | |
my ($credits, $join_phrases) = part { $i++ % 2 } @artist_joinphrase; | |
my @positions = (0..scalar @$credits - 1); | |
my @artists = map { $_->{artist} } @$credits; | |
my @names = map { $_->{name} } @$credits; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub _hash_to_row | |
{ | |
my ($self, $artist, $names) = @_; | |
no warnings 'uninitialized'; | |
my $row = { | |
name => $names->{$artist->{name}}, | |
sortname => $names->{$artist->{sort_name}} || $names->{$artist->{name}}, | |
begindate_year => $artist->{begin_date}->{year}, | |
begindate_month => $artist->{begin_date}->{month}, | |
begindate_day => $artist->{begin_date}->{day}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ollie@ollie-arch TemplateToolkit]$ ./admin/psql --profile=test READWRITE < ./admin/sql/InsertTestData.sql | |
BEGIN | |
SET | |
TRUNCATE TABLE | |
INSERT 0 1 | |
INSERT 0 1 | |
INSERT 0 1 | |
TRUNCATE TABLE | |
INSERT 0 1 | |
INSERT 0 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(gdb) bt | |
#0 0x00007f41f33d51a1 in strlen () from /lib/libc.so.6 | |
#1 0x000000000062c0b4 in textin () | |
#2 0x000000000066d964 in DirectFunctionCall1 () | |
#3 0x00007f41f103eb89 in unaccent () from /usr/lib/postgresql/unaccent.so | |
#4 0x000000000052bb9d in ExecMakeFunctionResult () | |
#5 0x0000000000529aae in ExecProject () | |
#6 0x000000000053aac9 in ExecResult () | |
#7 0x0000000000528f0d in ExecProcNode () | |
#8 0x0000000000526fe5 in ExecutorRun () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package MusicBrainz::Server::Edit::Artist::Edit; | |
use Moose; | |
use MusicBrainz::Server::Constants qw( $EDIT_ARTIST_EDIT ); | |
use MusicBrainz::Server::Types; | |
extends 'MusicBrainz::Server::Edit'; | |
sub name { 'Edit Artist' } | |
sub edit_type { $EDIT_ARTIST_EDIT } |