[mb-commits] branch, beta, updated. Merge remote-tracking branch 'freso/mbs-5523' into beta MBS-5523: Add test fo...

MusicBrainz Git Server <[email protected]>
Newsgroups gmane.comp.audio.musicbrainz.cvs
Message-ID <E1TVJj3-0004AX-HC@wiley>
The branch, beta has been updated
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=351416cdc79387ca364e54f247bc1d7a9cbc9656 (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=b66a11701fc6c57d9f12b307cec19ab0e47e9aac (commit)
       via  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=6816653558d7efab824c2a4cc537ea6525cd81d0 (commit)
      from  http://git.musicbrainz.org/gitweb/?p=musicbrainz-server/core.git;a=commit;h=c3554d8832c07db13cf0dd5ca30b332a06393e35 (commit)

Summary of changes:
 .../WebService/Serializer/JSON/2/Relation.pm       |    5 ++-
 .../Server/Controller/WS/2/JSON/LookupArtist.pm    |   45 +++++++++++++++++++-
 2 files changed, 48 insertions(+), 2 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 351416cdc79387ca364e54f247bc1d7a9cbc9656
Merge: c3554d8 b66a117
Author: warp <[email protected]>
Date:   Mon Nov 5 11:15:49 2012 +0100

    Merge remote-tracking branch 'freso/mbs-5523' into beta
    
    * freso/mbs-5523:
      MBS-5523: Add test for JSON WS ?inc=url-rels.
      MBS-5523: Add missing "url" in JSON WS url-rels output.


commit b66a11701fc6c57d9f12b307cec19ab0e47e9aac
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Sun Nov 4 04:57:45 2012 +0000

    MBS-5523: Add test for JSON WS ?inc=url-rels.

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 172a19f..3908471 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
@@ -73,6 +73,50 @@ test 'basic artist lookup, inc=aliases' => sub {
 
 };
 
+test 'basic artist lookup, inc=url-rels' => sub {
+
+    MusicBrainz::Server::Test->prepare_test_database(shift->c, '+webservice');
+
+    ws_test_json 'basic artist lookup, inc=url-rels',
+    '/artist/05d83760-08b5-42bb-a8d7-00d80b3bf47c?inc=url-rels' => encode_json (
+        {
+            id => "05d83760-08b5-42bb-a8d7-00d80b3bf47c",
+            name => "Paul Allgood",
+            "sort-name" => "Allgood, Paul",
+            country => JSON::null,
+            disambiguation => "",
+            type => "Person",
+            relations => [
+                {
+                    direction => "forward",
+                    url => "http://farm4.static.flickr.com/3652/3334818186_6e19173c33_b.jpg",
+                    type => "image"
+                    },
+                {
+                    direction => "forward",
+                    url => "http://members.boardhost.com/wedlock/",
+                    type => "online community"
+                    },
+                {
+                    direction => "forward",
+                    url => "http://www.discogs.com/artist/Paul+Allgood",
+                    type => "discogs"
+                    },
+                {
+                    direction => "forward",
+                    url => "http://www.imdb.com/name/nm4057169/",
+                    type => "IMDb"
+                    },
+                {
+                    direction => "forward",
+                    url => "http://www.paulallgood.com/",
+                    type => "blog"
+                    },
+                ],
+        });
+
+};
+
 test 'artist lookup with releases' => sub {
 
     MusicBrainz::Server::Test->prepare_test_database(shift->c, '+webservice');
@@ -495,4 +539,3 @@ test 'artist lookup with works (using l_recording_work)' => sub {
 };
 
 1;
-

commit 6816653558d7efab824c2a4cc537ea6525cd81d0
Author: Frederik "Freso" S. Olesen <[email protected]>
Date:   Sat Nov 3 21:38:09 2012 +0000

    MBS-5523: Add missing "url" in JSON WS url-rels output.

diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Relation.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Relation.pm
index 353eeff..49a492f 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Relation.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Relation.pm
@@ -23,6 +23,10 @@ sub serialize
     {
         $body{$entity->target_type} = serialize_entity ($entity->target);
     }
+    elsif ($entity->target_type eq 'url')
+    {
+        $body{$entity->target_type} = $entity->target->name
+    }
 
     return \%body;
 };
@@ -50,4 +54,3 @@ along with this program; if not, write to the Free Software
 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
 =cut
-

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


hooks/post-receive
-- 
mb_server
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.