[mb-commits] branch, beta, updated. Always render disambiguations as string (never as json null) and include them...

MusicBrainz Git Server <[email protected]>
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1TTXS4-00043L-5M@wiley>
The branch, beta has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=d68adec52a19616423c76e782c190aea1d46c56d (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=0015f8107b3589a131d1521217200244f5f77c08 (commit)

Summary of changes:
 .../Server/WebService/Serializer/JSON/2/Artist.pm  |    2 +-
 .../Server/WebService/Serializer/JSON/2/Label.pm   |    2 +-
 .../WebService/Serializer/JSON/2/Recording.pm      |    2 +-
 .../Server/WebService/Serializer/JSON/2/Release.pm |    2 +-
 .../WebService/Serializer/JSON/2/ReleaseGroup.pm   |    2 +-
 .../Server/WebService/Serializer/JSON/2/Work.pm    |    1 +
 .../Server/Controller/WS/2/JSON/LookupArtist.pm    |   16 ++++++++++++++++
 .../Server/Controller/WS/2/JSON/LookupLabel.pm     |    2 +-
 .../Server/Controller/WS/2/JSON/LookupRecording.pm |    2 +-
 .../Server/Controller/WS/2/JSON/LookupRelease.pm   |    2 +-
 .../Controller/WS/2/JSON/LookupReleaseGroup.pm     |    2 +-
 .../Server/Controller/WS/2/JSON/LookupWork.pm      |    4 ++++
 12 files changed, 30 insertions(+), 9 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 d68adec52a19616423c76e782c190aea1d46c56d
Author: warp <[email protected]>
Date:   Wed Oct 31 13:29:40 2012 +0100

    Always render disambiguations as string (never as json null) and include them in works (json /ws/2 webservice).

diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Artist.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Artist.pm
index 7e5108d..f9ecf41 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Artist.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Artist.pm
@@ -19,7 +19,7 @@ sub serialize
 
     $body{name} = $entity->name;
     $body{"sort-name"} = $entity->sort_name;
-    $body{disambiguation} = $entity->comment;
+    $body{disambiguation} = $entity->comment // "";
 
     if ($toplevel)
     {
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Label.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Label.pm
index eed6d29..981a066 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Label.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Label.pm
@@ -19,7 +19,7 @@ sub serialize
     $body{name} = $entity->name;
     $body{"sort-name"} = $entity->sort_name;
     $body{"label-code"} = number ($entity->label_code);
-    $body{disambiguation} = $entity->comment;
+    $body{disambiguation} = $entity->comment // "";
 
     if ($toplevel)
     {
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Recording.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Recording.pm
index 23d3c68..a49208a 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Recording.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Recording.pm
@@ -16,7 +16,7 @@ sub serialize
     my %body;
 
     $body{title} = $entity->name;
-    $body{disambiguation} = $entity->comment;
+    $body{disambiguation} = $entity->comment // "";
     $body{length} = $entity->length if $entity->length;
     $body{"artist-credit"} = serialize_entity ($entity->artist_credit)
         if ($entity->artist_credit &&
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Release.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Release.pm
index dda6e5b..c86fe33 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Release.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Release.pm
@@ -36,7 +36,7 @@ sub serialize
     $body{asin} = $entity->amazon_asin;
     $body{barcode} = $entity->barcode->code;
     $body{date} = $entity->date->format;
-    $body{disambiguation} = $entity->comment;
+    $body{disambiguation} = $entity->comment // "";
     $body{status} = $entity->status_name;
     $body{quality} = _quality ($entity->quality);
     $body{packaging} = $entity->packaging
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/ReleaseGroup.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/ReleaseGroup.pm
index af095b1..9f4f4d3 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/ReleaseGroup.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/ReleaseGroup.pm
@@ -19,7 +19,7 @@ sub serialize
     $body{"secondary-types"} = [ map {
         $_->name } $entity->all_secondary_types ];
     $body{"first-release-date"} = $entity->first_release_date->format;
-    $body{disambiguation} = $entity->comment;
+    $body{disambiguation} = $entity->comment // "";
 
     $body{"artist-credit"} = serialize_entity ($entity->artist_credit)
         if $inc && ($inc->artist_credits || $inc->artists);
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Work.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Work.pm
index 24ce822..109478a 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Work.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Work.pm
@@ -17,6 +17,7 @@ sub serialize
     my %body;
 
     $body{title} = $entity->name;
+    $body{disambiguation} = $entity->comment // "";
     $body{iswcs} = [ map { $_->iswc } @{ $entity->iswcs } ];
 
     return \%body;
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm
index c4ece12..0b287dc 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupArtist.pm
@@ -414,6 +414,7 @@ test 'artist lookup with works (using l_artist_work)' => sub {
                 {
                     id => "f5cdd40d-6dc3-358b-8d7d-22dd9d8f87a8",
                     title => "Asseswaving",
+                    disambiguation => "",
                     iswcs => [],
                 }
             ]
@@ -438,76 +439,91 @@ test 'artist lookup with works (using l_recording_work)' => sub {
                 {
                     id => "286ecfdd-2ffe-3bc7-b3e9-04cc8cea229b",
                     title => "Easy To Be Hard",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "2d967c29-63dc-309d-bbc1-a2d38639aaa1",
                     title => "心の手紙",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "303f9bd2-152f-3145-9e09-afa34edb6a57",
                     title => "DOUBLE",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "46724ef1-241e-3d7f-9f3b-e51ba34e2aa1",
                     title => "the Love Bug",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "4b6a46c2-a904-3471-9bff-3942d4549f47",
                     title => "SOME DAY ONE DAY )",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "50c07b24-7ee2-31ac-ab87-f0d399011c71",
                     title => "Milky Way 〜君の歌〜",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "511f5124-c0ae-3386-bb76-4b6521498a68",
                     title => "Milky Way-君の歌-",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "53d1fbac-e60a-38cb-85ff-e5a9224c9749",
                     title => "Be the one",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "61ab56f0-e803-3aef-a91b-63564b7a8043",
                     title => "Rock With You",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "6f08d5a8-1811-3e5e-848b-35ffa77babe5",
                     title => "Midnight Parade",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "7981d409-8e76-33df-be27-ef625d81c501",
                     title => "Shine We Are!",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "7e78f281-52b4-315b-9d7b-6d215732f3d7",
                     title => "EXPECT",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "cd86f9e2-83ce-3192-a817-fe6c98079303",
                     title => "Song With No Name~名前のない歌~",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "d2f1ea1f-de2e-3d0c-b534-e96377912478",
                     title => "OVER~across the time~",
+                    disambiguation => "",
                     iswcs => [],
                 },
                 {
                     id => "f23ae726-0300-3830-b1ca-634f4362f78c",
                     title => "LOVE & HONESTY",
+                    disambiguation => "",
                     iswcs => [],
                 }]
         });
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupLabel.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupLabel.pm
index 19a8e51..f5f459f 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupLabel.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupLabel.pm
@@ -45,7 +45,7 @@ test 'basic label lookup, inc=annotation' => sub {
             "sort-name" => "Warp Records",
             type => "Original Production",
             annotation => "this is a label annotation",
-            disambiguation => JSON::null,
+            disambiguation => "",
             "label-code" => 2070,
             country => "GB",
             "life-span" => {
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRecording.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRecording.pm
index d40d326..5af7a27 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRecording.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRecording.pm
@@ -37,7 +37,7 @@ test 'basic recording lookup, inc=annotation' => sub {
             title => "Plock",
             length => 237133,
             annotation => "this is a recording annotation",
-            disambiguation => JSON::null,
+            disambiguation => "",
         });
 
 };
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRelease.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRelease.pm
index e2151f4..f74e6f5 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRelease.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupRelease.pm
@@ -55,7 +55,7 @@ test 'basic release lookup, inc=annotation' => sub {
             barcode => "600116817020",
             asin => "B000KJTG6K",
             annotation => "this is a release annotation",
-            disambiguation => JSON::null,
+            disambiguation => "",
             packaging => JSON::null,
         });
 };
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupReleaseGroup.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupReleaseGroup.pm
index 95eba2a..d350fa7 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupReleaseGroup.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupReleaseGroup.pm
@@ -37,7 +37,7 @@ test 'basic release group lookup, inc=annotation' => sub {
             id => "22b54315-6e51-350b-bb34-e6e16f7688bd",
             title => "My Demons",
             annotation => "this is a release group annotation",
-            disambiguation => JSON::null,
+            disambiguation => "",
             "first-release-date" => "2007-01-29",
             "primary-type" => "Album",
             "secondary-types" => [],
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupWork.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupWork.pm
index 6046ad5..6c65271 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupWork.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/LookupWork.pm
@@ -23,6 +23,7 @@ test 'basic work lookup' => sub {
         {
             id => "3c37b9fa-a6c1-37d2-9e90-657a116d337c",
             title => "サマーれげぇ!レインボー",
+            disambiguation => "",
             iswcs => [ "T-000.000.002-0" ],
         });
 };
@@ -38,6 +39,7 @@ test 'basic work lookup, inc=annotation' => sub {
         {
             id => "482530c1-a2ab-32e8-be43-ea5240aa7913",
             title => "Plock",
+            disambiguation => "",
             annotation => "this is a work annotation",
             iswcs => [ ],
         });
@@ -62,6 +64,7 @@ test 'work lookup via iswc' => sub {
                 {
                     id => "3c37b9fa-a6c1-37d2-9e90-657a116d337c",
                     title => "サマーれげぇ!レインボー",
+                    disambiguation => "",
                     iswcs => [ "T-000.000.002-0" ],
                 }]
         });
@@ -76,6 +79,7 @@ test 'work lookup with recording relationships' => sub {
         {
             id => "3c37b9fa-a6c1-37d2-9e90-657a116d337c",
             title => "サマーれげぇ!レインボー",
+            disambiguation => "",
             relations => [
                 {
                     type => "performance",

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


hooks/post-receive
-- 
mb_server

_______________________________________________
MusicBrainz-commits mailing list
[email protected]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.