[mb-commits] branch, beta, updated. Merge branch 'mbs-3962-edit-search-exclude-linked-entity' into beta MBS-3962:...

MusicBrainz Git Server <[email protected]> Tue, 29 Jan 2013 05:29:53 +0000
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1U03lZ-00020k-5m@wiley>
The branch, beta has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=1d0f77c8c7d1f80e5004f7fa68a6272df8f713d4 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=0809694a72634efb32c572c682350c570a14896d (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=30d5104e82e4181ab0d5775ebb7bbdf67bc58032 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=dafc51582041fe8c87ee929fe40bcd1200d76d7f (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=182b8e2189af763d4e2fdb797b53fb693d0bd95f (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=63550252cafb5a6ace9cf37536791293cf745bdd (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=4298765fffae423af23e3732db797611668f31a4 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=ffeaad5487dc55fb05fec0fab54b45f18b33c51f (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=d993d87917125c5ade42c9291204e9fb78446e54 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=16c70abe2fa4b5eaa6522af3625e59168cb82570 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=f9728eadc0c54e44bca902dfa6ecde1e44b8fbd3 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=f8a92156070f4c94e42814ca1f51c515f548aa74 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=fc2f4997c3b8649c30796e54c26cccd6bdc2fd5e (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=2e133e328f00972878bd97de6694daf4168ceef6 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=f975cb6497b0788592f5e9cf59f8d41aaadb1f9e (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=0c664a701a6304fb14b0de92453936b878f5159c (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=6f036a170b6bb9dad41272456e3b2ad065259425 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=0d13395f82be68c9cd26a3a67077688c7805679f (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=bcb4055273ca9914d4b4e692d4b210233011323d (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=ea03a7321aa1489b1fb1af9cc7a6f2ce9059932d (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=09ee3a3db4adfc84d245a528b1e0406ca9d3a6c1 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=68effbbb9e5eadb6b101eecd32a33c45c3b2b7f5 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=1a1d7e6389dfc4efc409470b0265b357e5b563e0 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=3776a6383b1d7464af8f406ef1af7dea88b7fb06 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=29121ed5f9c4cdd5e0eb24e9568e7adff17b858d (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=d3fae058d771f0adb87db7faaec50dd9f1d8408a (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=4f75c0a6c3926eda7b66ec03f92df9d8b60c5974 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=780b552c96e7af975b7c01b192d8c2fcf9b8ac6b (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=b2ca44bce2f3c51766ecb2b666ac7a3a91679ad9 (commit)

Summary of changes:
 lib/MusicBrainz/Server/Controller/Release.pm       |    9 +-
 lib/MusicBrainz/Server/Data/Edit.pm                |   13 +++-
 lib/MusicBrainz/Server/Data/EntityAnnotation.pm    |   17 ++--
 lib/MusicBrainz/Server/Data/Release.pm             |    2 +-
 lib/MusicBrainz/Server/Edit/Release/AddCoverArt.pm |   15 +--
 .../Server/Edit/Release/EditCoverArt.pm            |   12 +--
 .../Server/Edit/Release/RemoveCoverArt.pm          |   17 +---
 .../Server/Edit/Release/ReorderCoverArt.pm         |    3 +-
 lib/MusicBrainz/Server/EditQueue.pm                |    2 +-
 .../Server/EditSearch/Predicate/LinkedEntity.pm    |    5 +-
 .../Server/EditSearch/Predicate/Vote.pm            |   13 +++
 lib/MusicBrainz/Server/Entity/Artwork.pm           |    6 ++
 root/artist/aliases.tt                             |    2 +-
 root/artist/index.tt                               |    2 +-
 root/artist/relationships.tt                       |    2 +-
 root/components/aliases.tt                         |    2 +-
 root/components/common-macros.tt                   |   10 ++-
 root/components/tags.tt                            |    2 +-
 root/edit/details/add_cover_art.tt                 |    9 +-
 root/edit/details/remove_cover_art.tt              |    7 +-
 root/edit/edit_header.tt                           |    8 +--
 root/edit/index.tt                                 |    6 +-
 root/recording/fingerprints.tt                     |    2 +-
 root/release/cover_art.tt                          |    2 +-
 root/static/images/layout/sprites.png              |  Bin 6672 -> 6440 bytes
 .../scripts/guess-case/MB/Control/GuessCase.js     |    2 +-
 .../guess-case/MB/GuessCase/Handler/Work.js        |   89 +++++++++++---------
 .../static/scripts/guess-case/MB/GuessCase/Main.js |   29 +++++++
 .../static/scripts/guess-case/MB/GuessCase/Work.js |    1 +
 root/static/styles/layout.css                      |    4 +
 root/user/collections.tt                           |    6 +-
 31 files changed, 177 insertions(+), 122 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 1d0f77c8c7d1f80e5004f7fa68a6272df8f713d4
Merge: 0809694 0c664a7
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:27:49 2013 -0700

    Merge branch 'mbs-3962-edit-search-exclude-linked-entity' into beta
    
    * mbs-3962-edit-search-exclude-linked-entity:
      MBS-3962: Actually reference the edit ID, rather than just filtering out anything that's been edited ever (thanks ocharles)
      MBS-3962: Really exclude artists/labels/etc. when "!=" is used


commit 0809694a72634efb32c572c682350c570a14896d
Merge: 30d5104 f975cb6
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:26:28 2013 -0700

    Merge branch 'mbs-5432-caa-types-i18n-2' into beta
    
    * mbs-5432-caa-types-i18n-2:
      MBS-5432/MBS-5776/etc.: fix cover art i18n


commit 30d5104e82e4181ab0d5775ebb7bbdf67bc58032
Merge: dafc515 2e133e3
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:25:58 2013 -0700

    Merge branch 'modbot-undef' into beta
    
    * modbot-undef:
      Make modbot correctly report no-action-taken edits in emails.


commit dafc51582041fe8c87ee929fe40bcd1200d76d7f
Merge: 182b8e2 fc2f499
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:25:23 2013 -0700

    Merge branch 'mbs-5786-artist-page-rg-secondary-type-i18n' into beta
    
    * mbs-5786-artist-page-rg-secondary-type-i18n:
      MBS-5786: translate release group secondary-type tag-labels on artist overview page


commit 182b8e2189af763d4e2fdb797b53fb693d0bd95f
Merge: 6355025 68effbb
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:24:38 2013 -0700

    Merge branch 'mbs-5144' into beta
    
    * mbs-5144:
      MBS-5144: quantize sprites.png and remove ancillary chunks that affect rendering


commit 63550252cafb5a6ace9cf37536791293cf745bdd
Merge: 4298765 1a1d7e6
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:23:55 2013 -0700

    Merge branch 'mbs-5395-actions-header-i18n' into beta
    
    * mbs-5395-actions-header-i18n:
      MBS-5395: remove fixed width for 'Actions' headers so longer languages don't break it
    
    Conflicts:
    	root/static/styles/layout.css

diff --cc root/static/styles/layout.css
index 34ac54d,5dd492b..716ac03
--- a/root/static/styles/layout.css
+++ b/root/static/styles/layout.css
@@@ -1009,8 -999,6 +1009,12 @@@ span.release-group-type 
      padding: 0 3px;
  }
  
 +a.tagger-icon {
 +    background: url('../images/icons/mblookup-tagger.png') no-repeat;
 +    width: 41px;
 +    height: 16px;
 +}
++
+ .actions-header {
+     min-width: 10em;
+ }

commit 4298765fffae423af23e3732db797611668f31a4
Merge: ffeaad5 bcb4055
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:22:48 2013 -0700

    Merge branch 'mbs-4522-empty-annotation-merge' into beta
    
    * mbs-4522-empty-annotation-merge:
      MBS-4522: use simpler conditional pointed out by ocharles
      MBS-4522: don't merge empty annotations


commit ffeaad5487dc55fb05fec0fab54b45f18b33c51f
Merge: d993d87 ea03a73
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:22:21 2013 -0700

    Merge branch 'mbs-3457-direct-search-recordings-not-standalone' into beta
    
    * mbs-3457-direct-search-recordings-not-standalone:
      MBS-3457: Improve release->find_by_recordings to not exclude some releases


commit d993d87917125c5ade42c9291204e9fb78446e54
Merge: 16c70ab 29121ed
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:21:49 2013 -0700

    Merge branch 'mbs-5506-edit-search-my-vote-not' into beta
    
    * mbs-5506-edit-search-my-vote-not:
      MBS-5506: Ensure "My Vote" with "!=" returns non-voted results unless asked to exclude them


commit 16c70abe2fa4b5eaa6522af3625e59168cb82570
Merge: f9728ea 6f036a1
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:21:09 2013 -0700

    Merge branch 'mbs-5566-autoedit-marking' into beta
    
    * mbs-5566-autoedit-marking:
      MBS-5566: break out edit vote-tally into its own macro
      MBS-5566: mark autoedits on edit-specific pages the same way they're marked in the listing


commit f9728eadc0c54e44bca902dfa6ecde1e44b8fbd3
Merge: f8a9215 0d13395
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:20:24 2013 -0700

    Merge branch 'mbs-5724-guess-work-alias-sortname' into beta
    
    * mbs-5724-guess-work-alias-sortname:
      MBS-5724: fix whitespace in GuessCase/Handler/Work.js
      MBS-5724: Ensure sortname bubble works properly for work alias sortnames


commit f8a92156070f4c94e42814ca1f51c515f548aa74
Merge: b2ca44b 780b552
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 28 22:19:34 2013 -0700

    Merge branch 'mbs-5762-incorrect-edit-foreign-key-loading' into beta
    
    * mbs-5762-incorrect-edit-foreign-key-loading:
      MBS-5762: ensure that in a listing of edits, edits processed later in the queue cannot clobber loading of foreign keys required by earlier edits


commit fc2f4997c3b8649c30796e54c26cccd6bdc2fd5e
Author: Ian McEwen <[email protected]>
Date:   Sun Jan 27 15:31:01 2013 -0700

    MBS-5786: translate release group secondary-type tag-labels on artist overview page

diff --git a/root/artist/index.tt b/root/artist/index.tt
index 6a682b9..5acca78 100644
--- a/root/artist/index.tt
+++ b/root/artist/index.tt
@@ -84,7 +84,7 @@
                       [% rdfa_made_rg_link(rg) %]
                       [% disambiguation(rg) %]
                       [% FOR t=rg.secondary_types %]
-                        <span class="release-group-type">[% t.name %]</span>
+                        <span class="release-group-type">[% t.l_name %]</span>
                       [% END %]
                     </td>
                     [% IF show_artists %]

commit 2e133e328f00972878bd97de6694daf4168ceef6
Author: Ian McEwen <[email protected]>
Date:   Sun Jan 27 01:41:29 2013 -0700

    Make modbot correctly report no-action-taken edits in emails.

diff --git a/lib/MusicBrainz/Server/EditQueue.pm b/lib/MusicBrainz/Server/EditQueue.pm
index b630189..2a7dd37 100644
--- a/lib/MusicBrainz/Server/EditQueue.pm
+++ b/lib/MusicBrainz/Server/EditQueue.pm
@@ -81,7 +81,7 @@ sub process_edits
         $self->log->info("Summary:\n");
         my @actions = sort { $a cmp $b } keys %stats;
         foreach my $action (@actions) {
-            $self->log->info(sprintf "  %-20.20s %d\n", $action_name{$action}, $stats{$action});
+            $self->log->info(sprintf "  %-20.20s %d\n", $action_name{$action} // '(no action)', $stats{$action});
         }
     }
 

commit f975cb6497b0788592f5e9cf59f8d41aaadb1f9e
Author: Ian McEwen <[email protected]>
Date:   Sat Jan 26 11:44:43 2013 -0700

    MBS-5432/MBS-5776/etc.: fix cover art i18n

diff --git a/lib/MusicBrainz/Server/Controller/Release.pm b/lib/MusicBrainz/Server/Controller/Release.pm
index 493743b..d0ac22b 100644
--- a/lib/MusicBrainz/Server/Controller/Release.pm
+++ b/lib/MusicBrainz/Server/Controller/Release.pm
@@ -466,16 +466,15 @@ sub reorder_cover_art : Chained('load') PathPart('reorder-cover-art') RequireAut
         $c->detach;
     }
 
-    my @artwork = @{
-        $c->model ('CoverArtArchive')->find_available_artwork($entity->gid)
-    } or $c->detach('/error_404');
+    my $artwork = $c->model ('Artwork')->find_by_release ($entity);
+    $c->model ('CoverArtType')->load_for (@$artwork);
 
-    $c->stash( images => \@artwork );
+    $c->stash( images => $artwork );
 
     my $count = 1;
     my @positions = map {
         { id => $_->id, position => $count++ }
-    } @artwork;
+    } @$artwork;
 
     my $form = $c->form(
         form => 'Release::ReorderCoverArt',
diff --git a/lib/MusicBrainz/Server/Edit/Release/AddCoverArt.pm b/lib/MusicBrainz/Server/Edit/Release/AddCoverArt.pm
index 611725c..c0a1628 100644
--- a/lib/MusicBrainz/Server/Edit/Release/AddCoverArt.pm
+++ b/lib/MusicBrainz/Server/Edit/Release/AddCoverArt.pm
@@ -10,6 +10,7 @@ use MusicBrainz::Server::Edit::Exceptions;
 use MusicBrainz::Server::Translation qw ( N_l );
 
 use aliased 'MusicBrainz::Server::Entity::Release';
+use aliased 'MusicBrainz::Server::Entity::Artwork';
 
 extends 'MusicBrainz::Server::Edit';
 with 'MusicBrainz::Server::Edit::Release';
@@ -100,20 +101,14 @@ sub build_display_data {
     my $release = $loaded->{Release}{ $self->data->{entity}{id} } ||
         Release->new( name => $self->data->{entity}{name} );
 
-    # FIXME: replace this with a proper MusicBrainz::Server::Entity::Artwork object
-    my $prefix = DBDefs->COVER_ART_ARCHIVE_DOWNLOAD_PREFIX . "/release/" . $release->gid . "/";
-    my $artwork = {
-        image => $prefix.$self->data->{cover_art_id}.'.jpg',
-        large_thumbnail => $prefix.$self->data->{cover_art_id}.'-500.jpg',
-        small_thumbnail => $prefix.$self->data->{cover_art_id}.'-250.jpg',
-    };
+    my $artwork = Artwork->new(release => $release,
+                               id => $self->data->{cover_art_id},
+                               comment => $self->data->{cover_art_comment},
+                               cover_art_types => [map {$loaded->{CoverArtType}{$_}} @{ $self->data->{cover_art_types} }]);
 
     return {
         release => $release,
         artwork => $artwork,
-        types => [ map { $loaded->{CoverArtType}{$_} }
-                       @{ $self->data->{cover_art_types} } ],
-        comment => $self->data->{cover_art_comment},
         position => $self->data->{cover_art_position}
     };
 }
diff --git a/lib/MusicBrainz/Server/Edit/Release/EditCoverArt.pm b/lib/MusicBrainz/Server/Edit/Release/EditCoverArt.pm
index 2aeb884..d9a7400 100644
--- a/lib/MusicBrainz/Server/Edit/Release/EditCoverArt.pm
+++ b/lib/MusicBrainz/Server/Edit/Release/EditCoverArt.pm
@@ -11,6 +11,7 @@ use MusicBrainz::Server::Edit::Utils qw( changed_display_data );
 use MusicBrainz::Server::Translation qw ( N_l );
 
 use aliased 'MusicBrainz::Server::Entity::Release';
+use aliased 'MusicBrainz::Server::Entity::Artwork';
 
 extends 'MusicBrainz::Server::Edit::WithDifferences';
 with 'MusicBrainz::Server::Edit::Release';
@@ -123,13 +124,10 @@ sub build_display_data {
     $data{release} = $loaded->{Release}{ $self->data->{entity}{id} } ||
         Release->new( name => $self->data->{entity}{name} );
 
-    # FIXME: replace this with a proper MusicBrainz::Server::Entity::Artwork object
-    my $prefix = DBDefs->COVER_ART_ARCHIVE_DOWNLOAD_PREFIX . "/release/" . $data{release}->gid . "/";
-    $data{artwork} = {
-        image => $prefix.$self->data->{id}.'.jpg',
-        large_thumbnail => $prefix.$self->data->{id}.'-500.jpg',
-        small_thumbnail => $prefix.$self->data->{id}.'-250.jpg',
-    };
+    $data{artwork} = Artwork->new(release => $data{release},
+                               id => $self->data->{id},
+                               comment => $self->data->{new}{comment} // '',
+                               cover_art_types => [map {$loaded->{CoverArtType}{$_}} @{ $self->data->{new}{types} }]);
 
     if ($self->data->{old}->{types})
     {
diff --git a/lib/MusicBrainz/Server/Edit/Release/RemoveCoverArt.pm b/lib/MusicBrainz/Server/Edit/Release/RemoveCoverArt.pm
index de78be7..918d17f 100644
--- a/lib/MusicBrainz/Server/Edit/Release/RemoveCoverArt.pm
+++ b/lib/MusicBrainz/Server/Edit/Release/RemoveCoverArt.pm
@@ -9,6 +9,7 @@ use MusicBrainz::Server::Edit::Exceptions;
 use MusicBrainz::Server::Translation qw ( N_l );
 
 use aliased 'MusicBrainz::Server::Entity::Release';
+use aliased 'MusicBrainz::Server::Entity::Artwork';
 
 extends 'MusicBrainz::Server::Edit';
 with 'MusicBrainz::Server::Edit::Release';
@@ -87,21 +88,13 @@ sub build_display_data {
     my $release = $loaded->{Release}{ $self->data->{entity}{id} } ||
         Release->new( name => $self->data->{entity}{name} );
 
-    # FIXME: replace this with a proper MusicBrainz::Server::Entity::Artwork object
-    my $prefix = DBDefs->COVER_ART_ARCHIVE_DOWNLOAD_PREFIX . "/release/" . $release->gid . "/";
-    my $artwork = {
-        image => $prefix.$self->data->{cover_art_id}.'.jpg',
-        large_thumbnail => $prefix.$self->data->{cover_art_id}.'-500.jpg',
-        small_thumbnail => $prefix.$self->data->{cover_art_id}.'-250.jpg',
-    };
-
+    my $artwork = Artwork->new(release => $release,
+                               id => $self->data->{cover_art_id},
+                               comment => $self->data->{cover_art_comment},
+                               cover_art_types => [map {$loaded->{CoverArtType}{$_}} @{ $self->data->{cover_art_types} }]);
     return {
         release => $release,
-        types => [
-            map { $loaded->{CoverArtType}{ $_ } } @{ $self->data->{cover_art_types} }
-        ],
         artwork => $artwork,
-        comment => $self->data->{cover_art_comment}
     };
 }
 
diff --git a/lib/MusicBrainz/Server/Edit/Release/ReorderCoverArt.pm b/lib/MusicBrainz/Server/Edit/Release/ReorderCoverArt.pm
index 80eb01f..16b2d4a 100644
--- a/lib/MusicBrainz/Server/Edit/Release/ReorderCoverArt.pm
+++ b/lib/MusicBrainz/Server/Edit/Release/ReorderCoverArt.pm
@@ -101,7 +101,8 @@ sub build_display_data {
     $data{release} = $loaded->{Release}{ $self->data->{entity}{id} } ||
         Release->new( name => $self->data->{entity}{name} );
 
-    my $artwork = $self->c->model('CoverArtArchive')->find_available_artwork ($data{release}->gid);
+    my $artwork = $self->c->model('Artwork')->find_by_release($data{release});
+    $self->c->model ('CoverArtType')->load_for(@$artwork);
 
     my %artwork_by_id = map { $_->id => $_ } @$artwork;
 
diff --git a/lib/MusicBrainz/Server/Entity/Artwork.pm b/lib/MusicBrainz/Server/Entity/Artwork.pm
index 0457931..4462b10 100644
--- a/lib/MusicBrainz/Server/Entity/Artwork.pm
+++ b/lib/MusicBrainz/Server/Entity/Artwork.pm
@@ -23,6 +23,12 @@ sub types {
     return [ map { $_->name } @{ $self->cover_art_types } ];
 }
 
+sub l_types {
+    my $self = shift;
+    return [] unless $self->cover_art_types;
+    return [ map { $_->l_name } @{ $self->cover_art_types } ];
+}
+
 has is_front => (
     is => 'rw',
     isa => 'Bool',
diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index b85b659..b9b5a55 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -75,7 +75,7 @@ END; -%]
     END -%]
 
 [%- MACRO artwork_hover(artwork) BLOCK -%]
-    [%- IF artwork.types; comma_only_list(artwork.types) | html; END %][% IF artwork.comment %] ([% artwork.comment | html%])[% END -%]
+    [%- IF artwork.l_types; comma_only_list(artwork.l_types) | html; END %][% IF artwork.comment %] ([% artwork.comment | html%])[% END -%]
 [%- END -%]
 
 [%- USE JavaScript -%]
diff --git a/root/edit/details/add_cover_art.tt b/root/edit/details/add_cover_art.tt
index ffc79d1..a0696ae 100644
--- a/root/edit/details/add_cover_art.tt
+++ b/root/edit/details/add_cover_art.tt
@@ -6,19 +6,18 @@
     <td>[% descriptive_link(edit.display_data.release) %]</td>
   </tr>
 
-  [% IF edit.display_data.comment %]
+  [% IF edit.display_data.artwork.comment %]
   <tr>
     <th>[% l('Comment:') %]</th>
-    <td>[% edit.display_data.comment | html %]</td>
+    <td>[% edit.display_data.artwork.comment | html %]</td>
   </tr>
   [% END %]
 
-  [% IF edit.display_data.types.size %]
+  [% IF edit.display_data.artwork.types.size %]
   <tr>
     <th>[% l('Types:') %]</th>
     <td>
-        [% USE Map %]
-        [% comma_only_list(edit.display_data.types.map('l_name')) | html %]
+        [% comma_only_list(edit.display_data.artwork.l_types) | html %]
     </td>
   </tr>
   [% END %]
diff --git a/root/edit/details/remove_cover_art.tt b/root/edit/details/remove_cover_art.tt
index 3421c3c..28ffa70 100644
--- a/root/edit/details/remove_cover_art.tt
+++ b/root/edit/details/remove_cover_art.tt
@@ -9,9 +9,8 @@
   <tr>
     <th>[% l('Types:') %]</th>
     <td>
-      [% IF edit.display_data.types.size %]
-        [% USE Map %]
-        [% comma_only_list(edit.display_data.types.map('l_name')) | html %]
+      [% IF edit.display_data.artwork.types.size %]
+        [% comma_only_list(edit.display_data.artwork.l_types) | html %]
       [% ELSE %]
         [% l('(none)') %]
       [% END %]
@@ -25,7 +24,7 @@
 
   <tr>
     <th>[% l('Comment:') %]</th>
-    <td>[% html_escape(edit.display_data.comment) || l('(none)') %]</td>
+    <td>[% html_escape(edit.display_data.artwork.comment) || l('(none)') %]</td>
   </tr>
 
   [%- display_edit_artwork(edit.display_data.artwork, edit.display_data.release) -%]
diff --git a/root/release/cover_art.tt b/root/release/cover_art.tt
index d5afd6c..328e69e 100644
--- a/root/release/cover_art.tt
+++ b/root/release/cover_art.tt
@@ -11,7 +11,7 @@
         </div>
         <p>
           [%- l('Types:') -%]
-          [% comma_only_list(artwork.types) || '-' %]
+          [% comma_only_list(artwork.l_types) || '-' %]
         </p>
         [%- IF artwork.comment -%]
         <p>

commit 0c664a701a6304fb14b0de92453936b878f5159c
Author: Ian McEwen <[email protected]>
Date:   Fri Jan 25 18:39:47 2013 -0700

    MBS-3962: Actually reference the edit ID, rather than just filtering out anything that's been edited ever (thanks ocharles)

diff --git a/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm b/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
index 269b8c4..5d8ea84 100644
--- a/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
+++ b/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
@@ -44,7 +44,7 @@ role {
 
             when ('!=') {
                 $query->add_where([
-                    "NOT EXISTS (SELECT TRUE from $table edit_entity WHERE edit_entity.$column = ?)",
+                    "NOT EXISTS (SELECT TRUE from $table edit_entity WHERE edit_entity.edit = edit.id AND edit_entity.$column = ?)",
                     $self->sql_arguments
                 ]);
             }

commit 6f036a170b6bb9dad41272456e3b2ad065259425
Author: Ian McEwen <[email protected]>
Date:   Fri Jan 25 14:24:37 2013 -0700

    MBS-5566: break out edit vote-tally into its own macro

diff --git a/root/components/common-macros.tt b/root/components/common-macros.tt
index ee84d23..3fe646c 100644
--- a/root/components/common-macros.tt
+++ b/root/components/common-macros.tt
@@ -645,6 +645,14 @@ END -%]
     [%- END -%]
 [%- END -%]
 
+[%- MACRO vote_tally(edit) BLOCK -%]
+    [%- IF edit.auto_edit; '<strong>' _ l('automatically applied') _ '</strong>';
+       ELSE; l('{yes} yes : {no} no',
+        { yes => '<strong>' _ edit.yes_votes _ '</strong>',
+          no => '<strong>' _ edit.no_votes _ '</strong>' });
+    END -%]
+[%- END -%]
+
 [%- MACRO display_relationship(relationship, phrase_field) BLOCK; -%]
             [% phrase_field = phrase_field || 'phrase' %]
             [%- IF relationship.edits_pending %]<span class="mp">[% END -%]
diff --git a/root/edit/edit_header.tt b/root/edit/edit_header.tt
index 85bc25d..dbff018 100644
--- a/root/edit/edit_header.tt
+++ b/root/edit/edit_header.tt
@@ -46,13 +46,7 @@
                     </td>
                     <td class="vote-count">
                         [% IF edit.latest_vote_for_editor(c.user.id) || c.user.id == edit.editor_id || !edit.is_open %]
-                            <div>
-                                [%- IF edit.auto_edit; '<strong>' _ l('automatically applied') _ '</strong>';
-                                    ELSE; l('{yes} yes : {no} no',
-                                     { yes => '<strong>' _ edit.yes_votes _ '</strong>',
-                                       no => '<strong>' _ edit.no_votes _ '</strong>' });
-                                END -%]
-                            </div>
+                            <div>[%- vote_tally(edit) -%]</div>
                         [% END %]
                     </td>
                 </tr>
diff --git a/root/edit/index.tt b/root/edit/index.tt
index ad39738..2aa164d 100644
--- a/root/edit/index.tt
+++ b/root/edit/index.tt
@@ -24,13 +24,7 @@
           <table class="vote-tally">
             <tr class="noborder">
                 <th>[% l('Vote tally:') %]</th>
-                <td class="vote">
-                    [%- IF edit.auto_edit; '<strong>' _ l('automatically applied') _ '</strong>';
-                       ELSE; l('{yes} yes : {no} no',
-                        { yes => '<strong>' _ edit.yes_votes _ '</strong>',
-                          no => '<strong>' _ edit.no_votes _ '</strong>' });
-                    END -%]
-                </td>
+                <td class="vote">[%- vote_tally(edit) -%]</td>
             </tr>
             [% IF edit.editor_may_vote(c.user) %]
                 <tr class="noborder">

commit 0d13395f82be68c9cd26a3a67077688c7805679f
Author: Ian McEwen <[email protected]>
Date:   Fri Jan 25 14:07:36 2013 -0700

    MBS-5724: fix whitespace in GuessCase/Handler/Work.js

diff --git a/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js b/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
index b93886e..799bea2 100644
--- a/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
+++ b/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
@@ -32,40 +32,40 @@ MB.GuessCase.Handler.Work = function () {
      * Checks special cases of releases
      **/
     self.checkSpecialCase = function(is) {
-	if (is) {
-	    if (!gc.re.RELEASE_UNTITLED) {
-		// untitled
-		gc.re.RELEASE_UNTITLED = /^([\(\[]?\s*untitled\s*[\)\]]?)$/i;
-	    }
-	    if (is.match(gc.re.RELEASE_UNTITLED)) {
-		return self.SPECIALCASE_UNTITLED;
-	    }
-	}
-	return self.NOT_A_SPECIALCASE;
+        if (is) {
+            if (!gc.re.RELEASE_UNTITLED) {
+                // untitled
+                gc.re.RELEASE_UNTITLED = /^([\(\[]?\s*untitled\s*[\)\]]?)$/i;
+            }
+            if (is.match(gc.re.RELEASE_UNTITLED)) {
+                return self.SPECIALCASE_UNTITLED;
+            }
+        }
+        return self.NOT_A_SPECIALCASE;
     };
 
     /**
      * Guess the releasename given in string is, and
      * returns the guessed name.
      *
-     * @param	is		the inputstring
-     * @returns os		the processed string
+     * @param        is                the inputstring
+     * @returns os                the processed string
      **/
     self.process = function(is) {
-	is = gc.mode.stripInformationToOmit(is);
-	is = gc.mode.preProcessCommons(is);
-	is = gc.mode.preProcessTitles(is);
-	var words = gc.i.splitWordsAndPunctuation(is);
-	words = gc.mode.prepExtraTitleInfo(words);
-	gc.o.init();
-	gc.i.init(is, words);
-	while (!gc.i.isIndexAtEnd()) {
-	    self.processWord();
-	}
-	var os = gc.o.getOutput();
-	os = gc.mode.runPostProcess(os);
-	os = gc.mode.runFinalChecks(os);
-	return os;
+        is = gc.mode.stripInformationToOmit(is);
+        is = gc.mode.preProcessCommons(is);
+        is = gc.mode.preProcessTitles(is);
+        var words = gc.i.splitWordsAndPunctuation(is);
+        words = gc.mode.prepExtraTitleInfo(words);
+        gc.o.init();
+        gc.i.init(is, words);
+        while (!gc.i.isIndexAtEnd()) {
+            self.processWord();
+        }
+        var os = gc.o.getOutput();
+        os = gc.mode.runPostProcess(os);
+        os = gc.mode.runFinalChecks(os);
+        return os;
     };
 
     /**
@@ -83,28 +83,28 @@ MB.GuessCase.Handler.Work = function () {
         if (self.doDiscNumberStyle()) {
         } else if (self.doIgnoreWords ()) {
         } else if (self.doFeaturingArtistStyle()) {
-	} else if (self.doVersusStyle()) {
-	} else if (self.doVolumeNumberStyle()) {
-	} else if (self.doPartNumberStyle()) {
-	} else if (gc.mode.doWord()) {
-	} else {
-	    // handle normal word.
-	    gc.o.appendSpaceIfNeeded();
-	    gc.i.capitalizeCurrentWord();
-	    gc.o.appendCurrentWord();
-	    gc.f.resetContext();
-	    gc.f.forceCaps = false;
-	    gc.f.spaceNextWord = true;
-	}
-	gc.f.number = false;
-	return null;
+        } else if (self.doVersusStyle()) {
+        } else if (self.doVolumeNumberStyle()) {
+        } else if (self.doPartNumberStyle()) {
+        } else if (gc.mode.doWord()) {
+        } else {
+            // handle normal word.
+            gc.o.appendSpaceIfNeeded();
+            gc.i.capitalizeCurrentWord();
+            gc.o.appendCurrentWord();
+            gc.f.resetContext();
+            gc.f.forceCaps = false;
+            gc.f.spaceNextWord = true;
+        }
+        gc.f.number = false;
+        return null;
     };
 
     /**
      * Guesses the sortname for works
      **/
     self.guessSortName = function(is) {
-	return gc.u.trim(is);
+        return gc.u.trim(is);
     };
 
     return self;

commit bcb4055273ca9914d4b4e692d4b210233011323d
Author: Ian McEwen <[email protected]>
Date:   Fri Jan 25 14:05:45 2013 -0700

    MBS-4522: use simpler conditional pointed out by ocharles

diff --git a/lib/MusicBrainz/Server/Data/EntityAnnotation.pm b/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
index 0620a82..e2e1934 100644
--- a/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
+++ b/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
@@ -2,7 +2,6 @@ package MusicBrainz::Server::Data::EntityAnnotation;
 use Moose;
 use namespace::autoclean;
 
-use List::AllUtils qw( any );
 use HTML::Entities qw( decode_entities );
 use MusicBrainz::Server::Constants qw(
     $EDITOR_MODBOT
@@ -154,7 +153,7 @@ sub merge
 
     if (keys %entity_to_annotation > 1) {
         my $new_text = join("\n\n-------\n\n", grep { $_ ne "" } values %entity_to_annotation);
-        if (any { $_ ne $new_text } values %entity_to_annotation) {
+        if ($new_text ne '') {
             $self->c->model('Edit')->create(
                 edit_type => $ANNOTATION_TYPE_MAP{$type},
                 editor_id => $EDITOR_MODBOT,

commit ea03a7321aa1489b1fb1af9cc7a6f2ce9059932d
Author: Ian McEwen <[email protected]>
Date:   Thu Jan 24 15:20:32 2013 -0700

    MBS-3457: Improve release->find_by_recordings to not exclude some releases
    
     * it was selecting DISTINCT ON (release.id), meaning that if multiple
       recordings being searched appeared on the same release only one would
       actually get marked as such
     * now is DISTINCT ON (release.id, track.recording) instead

diff --git a/lib/MusicBrainz/Server/Data/Release.pm b/lib/MusicBrainz/Server/Data/Release.pm
index 9238f0a..c6a6339 100644
--- a/lib/MusicBrainz/Server/Data/Release.pm
+++ b/lib/MusicBrainz/Server/Data/Release.pm
@@ -348,7 +348,7 @@ sub find_by_recordings
     return () unless @ids;
 
     my $query =
-        "SELECT DISTINCT ON (release.id) " . $self->_columns . ",
+        "SELECT DISTINCT ON (release.id, track.recording) " . $self->_columns . ",
                 track.recording, track.position
            FROM release
            JOIN release_name name ON name.id = release.name

commit 09ee3a3db4adfc84d245a528b1e0406ca9d3a6c1
Author: Ian McEwen <[email protected]>
Date:   Wed Jan 23 10:51:03 2013 -0700

    MBS-3962: Really exclude artists/labels/etc. when "!=" is used

diff --git a/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm b/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
index f68d35c..269b8c4 100644
--- a/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
+++ b/lib/MusicBrainz/Server/EditSearch/Predicate/LinkedEntity.pm
@@ -33,10 +33,10 @@ role {
         my $table = join('_', 'edit', $params->type);
         my $column = $params->type;
         my $alias = $table . $join_idx;
-        $query->add_join("JOIN $table $alias ON $alias.edit = edit.id");
 
         given($self->operator) {
             when('=') {
+                $query->add_join("JOIN $table $alias ON $alias.edit = edit.id");
                 $query->add_where([
                     "$alias.$column = ?", $self->sql_arguments
                 ]);
@@ -44,7 +44,8 @@ role {
 
             when ('!=') {
                 $query->add_where([
-                    "$alias.$column != ?", $self->sql_arguments
+                    "NOT EXISTS (SELECT TRUE from $table edit_entity WHERE edit_entity.$column = ?)",
+                    $self->sql_arguments
                 ]);
             }
         };

commit 68effbbb9e5eadb6b101eecd32a33c45c3b2b7f5
Author: Ian McEwen <[email protected]>
Date:   Wed Jan 23 10:29:35 2013 -0700

    MBS-5144: quantize sprites.png and remove ancillary chunks that affect rendering

diff --git a/root/static/images/layout/sprites.png b/root/static/images/layout/sprites.png
index 66c8875..94f1146 100644
Binary files a/root/static/images/layout/sprites.png and b/root/static/images/layout/sprites.png differ

commit 1a1d7e6389dfc4efc409470b0265b357e5b563e0
Author: Ian McEwen <[email protected]>
Date:   Wed Jan 23 10:12:54 2013 -0700

    MBS-5395: remove fixed width for 'Actions' headers so longer languages don't break it

diff --git a/root/artist/aliases.tt b/root/artist/aliases.tt
index 8076cac..0f88b4c 100644
--- a/root/artist/aliases.tt
+++ b/root/artist/aliases.tt
@@ -19,7 +19,7 @@
                         [% l('Name') %]
                     </th>
                     [% IF c.user_exists %]
-                    <th style="width: 5em">
+                    <th class="actions-header">
                         [% l('Actions') %]
                     </th>
                     [% END %]
diff --git a/root/artist/relationships.tt b/root/artist/relationships.tt
index 8015fc3..5430a72 100644
--- a/root/artist/relationships.tt
+++ b/root/artist/relationships.tt
@@ -15,7 +15,7 @@
                 <th>[% l('Attributes') %]</th>
                 <th>[% l('Artist') %]</th>
                 [% IF c.user_exists %]
-                <th style="width: 10em">[% l('Edit') %]</th>
+                <th class="actions-header">[% l('Edit') %]</th>
                 [% END %]
             </tr>
         </thead>
diff --git a/root/components/aliases.tt b/root/components/aliases.tt
index 7f5c6e6..f7c0c53 100644
--- a/root/components/aliases.tt
+++ b/root/components/aliases.tt
@@ -15,7 +15,7 @@
                     <th>[% l('Type') %]</th>
                     <th>[% l('Locale') %]</th>
                     [% IF c.user_exists %]
-                        <th style="width: 10em">
+                        <th class="actions-header">
                             [% l('Actions') %]
                         </th>
                     [% END %]
diff --git a/root/components/tags.tt b/root/components/tags.tt
index 051ca63..55fed5c 100644
--- a/root/components/tags.tt
+++ b/root/components/tags.tt
@@ -10,7 +10,7 @@
       <thead>
         <tr>
           <th>[% lp('Tag', 'noun') %]</th>
-          <th style="width: 10em">[% l('Usage Count') %]</th>
+          <th class="actions-header">[% l('Usage Count') %]</th>
         </tr>
       </thead>
       <tbody>
diff --git a/root/recording/fingerprints.tt b/root/recording/fingerprints.tt
index 1981b51..02edafa 100644
--- a/root/recording/fingerprints.tt
+++ b/root/recording/fingerprints.tt
@@ -10,7 +10,7 @@
                 <tr>
                     <th>[% l('PUID') %]</th>
                     [% IF c.user_exists %]
-                        <th style="width: 5em">
+                        <th class="actions-header">
                             [% l('Actions') %]
                         </th>
                     [% END %]
diff --git a/root/static/styles/layout.css b/root/static/styles/layout.css
index 4b73fb4..5dd492b 100644
--- a/root/static/styles/layout.css
+++ b/root/static/styles/layout.css
@@ -998,3 +998,7 @@ span.release-group-type {
     border-radius: 3px;
     padding: 0 3px;
 }
+
+.actions-header {
+    min-width: 10em;
+}
diff --git a/root/user/collections.tt b/root/user/collections.tt
index 2f951f9..ae21994 100644
--- a/root/user/collections.tt
+++ b/root/user/collections.tt
@@ -7,10 +7,10 @@
     <thead>
         <tr>
             <th>[% l('Collection') %]</th>
-            <th style="width: 10em">[% l('Releases') %]</th>
+            <th>[% l('Releases') %]</th>
             [% IF viewing_own_profile %]
-            <th style="width: 10em">[% l('Privacy') %]</th>
-            <th style="width: 10em">[% l('Actions') %]</th>
+            <th>[% l('Privacy') %]</th>
+            <th class="actions-header">[% l('Actions') %]</th>
             [% END %]
         </tr>
     </thead>

commit 3776a6383b1d7464af8f406ef1af7dea88b7fb06
Author: Ian McEwen <[email protected]>
Date:   Tue Jan 22 16:56:27 2013 -0700

    MBS-4522: don't merge empty annotations

diff --git a/lib/MusicBrainz/Server/Data/EntityAnnotation.pm b/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
index 5582cbd..0620a82 100644
--- a/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
+++ b/lib/MusicBrainz/Server/Data/EntityAnnotation.pm
@@ -2,6 +2,7 @@ package MusicBrainz::Server::Data::EntityAnnotation;
 use Moose;
 use namespace::autoclean;
 
+use List::AllUtils qw( any );
 use HTML::Entities qw( decode_entities );
 use MusicBrainz::Server::Constants qw(
     $EDITOR_MODBOT
@@ -152,13 +153,16 @@ sub merge
     };
 
     if (keys %entity_to_annotation > 1) {
-        $self->c->model('Edit')->create(
-            edit_type => $ANNOTATION_TYPE_MAP{$type},
-            editor_id => $EDITOR_MODBOT,
-            entity => $self->c->model(type_to_model($type))->get_by_id($new_id),
-            text => join("\n\n-------\n\n", values %entity_to_annotation),
-            changelog => "Result of $type merge"
-        );
+        my $new_text = join("\n\n-------\n\n", grep { $_ ne "" } values %entity_to_annotation);
+        if (any { $_ ne $new_text } values %entity_to_annotation) {
+            $self->c->model('Edit')->create(
+                edit_type => $ANNOTATION_TYPE_MAP{$type},
+                editor_id => $EDITOR_MODBOT,
+                entity => $self->c->model(type_to_model($type))->get_by_id($new_id),
+                text => $new_text,
+                changelog => "Result of $type merge"
+            );
+        }
     }
 
     $self->sql->do("UPDATE $table SET $type = ?

commit 29121ed5f9c4cdd5e0eb24e9568e7adff17b858d
Author: Ian McEwen <[email protected]>
Date:   Tue Jan 22 16:07:28 2013 -0700

    MBS-5506: Ensure "My Vote" with "!=" returns non-voted results unless asked to exclude them

diff --git a/lib/MusicBrainz/Server/EditSearch/Predicate/Vote.pm b/lib/MusicBrainz/Server/EditSearch/Predicate/Vote.pm
index 120b994..b68c9bc 100644
--- a/lib/MusicBrainz/Server/EditSearch/Predicate/Vote.pm
+++ b/lib/MusicBrainz/Server/EditSearch/Predicate/Vote.pm
@@ -83,6 +83,19 @@ sub combine_with_query {
                     ]
                 ]);
             }
+            elsif (@votes && !$no_vote_option) {
+                $query->add_where([
+                    join(' OR ',
+                         sprintf($sql, "vote.vote != all(?)"),
+                         sprintf("NOT $sql", "TRUE")
+                    ),
+                    [
+                        $self->voter_id,
+                        \@votes,
+                        $self->voter_id,
+                    ]
+                ]);
+            }
             else {
                 $query->add_where([
                     sprintf($sql, "vote.vote != all(?)"),

commit d3fae058d771f0adb87db7faaec50dd9f1d8408a
Author: Ian McEwen <[email protected]>
Date:   Tue Jan 22 15:35:33 2013 -0700

    MBS-5566: mark autoedits on edit-specific pages the same way they're marked in the listing

diff --git a/root/edit/index.tt b/root/edit/index.tt
index 57d66c6..ad39738 100644
--- a/root/edit/index.tt
+++ b/root/edit/index.tt
@@ -25,9 +25,11 @@
             <tr class="noborder">
                 <th>[% l('Vote tally:') %]</th>
                 <td class="vote">
-                    [%- l('{yes} yes : {no} no',
-                         { yes => '<strong>' _ edit.yes_votes _ '</strong>',
-                           no => '<strong>' _ edit.no_votes _ '</strong>' }) -%]
+                    [%- IF edit.auto_edit; '<strong>' _ l('automatically applied') _ '</strong>';
+                       ELSE; l('{yes} yes : {no} no',
+                        { yes => '<strong>' _ edit.yes_votes _ '</strong>',
+                          no => '<strong>' _ edit.no_votes _ '</strong>' });
+                    END -%]
                 </td>
             </tr>
             [% IF edit.editor_may_vote(c.user) %]

commit 4f75c0a6c3926eda7b66ec03f92df9d8b60c5974
Author: Ian McEwen <[email protected]>
Date:   Tue Jan 22 14:44:30 2013 -0700

    MBS-5724: Ensure sortname bubble works properly for work alias sortnames

diff --git a/root/static/scripts/guess-case/MB/Control/GuessCase.js b/root/static/scripts/guess-case/MB/Control/GuessCase.js
index f9ff77b..726cff3 100644
--- a/root/static/scripts/guess-case/MB/Control/GuessCase.js
+++ b/root/static/scripts/guess-case/MB/Control/GuessCase.js
@@ -94,7 +94,7 @@ MB.Control.initialize_guess_case = function (bubbles, type, form_prefix) {
     bubbles.add ($name, $gcdoc);
     MB.Control.GuessCase (type, $name);
 
-    if (type === 'label' || type === 'artist')
+    if (type === 'label' || type === 'artist' || type === 'work')
     {
         var $sortname = $('input#' + form_prefix + '\\.sort_name');
         var $sortdoc = $('div.sortname.bubble');
diff --git a/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js b/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
index 7b67b18..b93886e 100644
--- a/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
+++ b/root/static/scripts/guess-case/MB/GuessCase/Handler/Work.js
@@ -100,5 +100,12 @@ MB.GuessCase.Handler.Work = function () {
 	return null;
     };
 
+    /**
+     * Guesses the sortname for works
+     **/
+    self.guessSortName = function(is) {
+	return gc.u.trim(is);
+    };
+
     return self;
 };
diff --git a/root/static/scripts/guess-case/MB/GuessCase/Main.js b/root/static/scripts/guess-case/MB/GuessCase/Main.js
index 0fbfec2..cb22490 100644
--- a/root/static/scripts/guess-case/MB/GuessCase/Main.js
+++ b/root/static/scripts/guess-case/MB/GuessCase/Main.js
@@ -227,6 +227,35 @@ MB.GuessCase.Main = function () {
     };
 
     /**
+     * Guess the sortname of a given work name
+     * @param	 is		the un-processed input string
+     * @returns			the processed string
+     **/
+    self.guessWorkSortname = function(is) {
+	var os, handler;
+	gc.init();
+
+	if (!self.workHandler) {
+	    self.workHandler = MB.GuessCase.Handler.Work ();
+	}
+	handler = self.workHandler;
+
+	// we need to query the handler if the input string is
+	// a special case, fetch the correct format, if the
+	// returned case is indeed a special case.
+	var num = handler.checkSpecialCase(is);
+	if (handler.isSpecialCase(num)) {
+	    os = handler.getSpecialCaseFormatted(is, num);
+	} else {
+	    // if it was not a special case, start Guessing
+	    os = handler.guessSortName(is);
+	}
+
+	return os;
+    };
+
+
+    /**
      * Guess the capitalization of n release name
      * @param	 is		the un-processed input string
      * @returns			the processed string
diff --git a/root/static/scripts/guess-case/MB/GuessCase/Work.js b/root/static/scripts/guess-case/MB/GuessCase/Work.js
index f261f71..0f439ee 100644
--- a/root/static/scripts/guess-case/MB/GuessCase/Work.js
+++ b/root/static/scripts/guess-case/MB/GuessCase/Work.js
@@ -27,6 +27,7 @@ MB.GuessCase._Work = function () {
     self.gc = MB.GuessCase.Main ();
 
     self.guess = self.gc.guessWork;
+    self.sortname = self.gc.guessWorkSortname;
 
     return self;
 };

commit 780b552c96e7af975b7c01b192d8c2fcf9b8ac6b
Author: Ian McEwen <[email protected]>
Date:   Mon Jan 21 17:30:25 2013 -0700

    MBS-5762: ensure that in a listing of edits, edits processed later in the queue cannot clobber loading of foreign keys required by earlier edits

diff --git a/lib/MusicBrainz/Server/Data/Edit.pm b/lib/MusicBrainz/Server/Data/Edit.pm
index 008a868..000d3fc 100644
--- a/lib/MusicBrainz/Server/Data/Edit.pm
+++ b/lib/MusicBrainz/Server/Data/Edit.pm
@@ -7,6 +7,7 @@ use Data::OptList;
 use DateTime;
 use Try::Tiny;
 use List::MoreUtils qw( uniq zip );
+use List::AllUtils qw( any );
 use MusicBrainz::Server::Constants qw( $QUALITY_UNKNOWN_MAPPED $EDITOR_MODBOT );
 use MusicBrainz::Server::Data::Editor;
 use MusicBrainz::Server::EditRegistry;
@@ -459,8 +460,16 @@ sub load_all
             $ids = Data::OptList::mkopt_hash($ids);
             while (my ($object_id, $extra_models) = each %$ids) {
                 push @{ $objects_to_load->{$model} }, $object_id;
-                $post_load_models->{$model}->{$object_id} = $extra_models
-                    if $extra_models && @$extra_models;
+                if ($extra_models && @$extra_models) {
+                    if (!exists $post_load_models->{$model}->{$object_id}) {
+                        $post_load_models->{$model}->{$object_id} = $extra_models;
+                    } else {
+                        for my $extra_model (@$extra_models) {
+                            push @{ $post_load_models->{$model}->{$object_id} }, $extra_model
+                              unless (any { $_ eq $extra_model } @{ $post_load_models->{$model}->{$object_id} });
+                        }
+                    }
+                }
             }
         }
     }

-----------------------------------------------------------------------


hooks/post-receive
-- 
mb_server