[mb-commits] branch, mbs-5711, created. MBS-5711, do not include IPIs in json webservice unless they' re on a toplevel...
MusicBrainz Git Server <[email protected]> Tue, 15 Jan 2013 09:31:21 +0000
| Newsgroups | gmane.comp.audio.musicbrainz.cvs |
|---|---|
| Message-ID | <E1Tv2rZ-0001sD-2x@wiley> |
The branch, mbs-5711 has been created
at 43f33f78acd2123028d6c9bf7da4387c3981b367 (commit)
- Log -----------------------------------------------------------------
commit 43f33f78acd2123028d6c9bf7da4387c3981b367
Author: warp <[email protected]>
Date: Tue Jan 15 10:21:59 2013 +0100
MBS-5711, do not include IPIs in json webservice unless they're on a toplevel entity.
diff --git a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Role/IPIs.pm b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Role/IPIs.pm
index 94d0213..193457d 100644
--- a/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Role/IPIs.pm
+++ b/lib/MusicBrainz/Server/WebService/Serializer/JSON/2/Role/IPIs.pm
@@ -7,6 +7,8 @@ around serialize => sub {
my ($orig, $self, $entity, $inc, $stash, $toplevel) = @_;
my $ret = $self->$orig($entity, $inc, $stash, $toplevel);
+ return $ret unless $toplevel;
+
$ret->{ipis} = [ map { $_->ipi } $entity->all_ipi_codes ];
return $ret;
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleaseGroups.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleaseGroups.pm
index 1a403ed..e2fedf6 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleaseGroups.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleaseGroups.pm
@@ -33,7 +33,6 @@ test 'browse release group via release' => sub {
name => "Distance",
"sort-name" => "Distance",
disambiguation => "UK dubstep artist Greg Sanders",
- ipis => [],
},
joinphrase => "",
}],
@@ -71,7 +70,6 @@ test 'browse release group via artist' => sub {
name => "Distance",
"sort-name" => "Distance",
disambiguation => "UK dubstep artist Greg Sanders",
- ipis => [],
},
joinphrase => "",
}],
@@ -96,7 +94,6 @@ test 'browse release group via artist' => sub {
name => "Distance",
"sort-name" => "Distance",
disambiguation => "UK dubstep artist Greg Sanders",
- ipis => [],
},
joinphrase => "",
}],
diff --git a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleases.pm b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleases.pm
index 06c17ba..51e912f 100644
--- a/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleases.pm
+++ b/t/lib/t/MusicBrainz/Server/Controller/WS/2/JSON/BrowseReleases.pm
@@ -162,7 +162,6 @@ test 'browse releases via recording' => sub {
"sort-name" => "avex trax",
"label-code" => JSON::null,
disambiguation => "",
- ipis => [],
}
}],
disambiguation => "",
@@ -187,7 +186,6 @@ test 'browse releases via recording' => sub {
"sort-name" => "avex trax",
"label-code" => JSON::null,
disambiguation => "",
- ipis => [],
}
}],
disambiguation => "",
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 b61747e..5f0ec70 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
@@ -348,7 +348,6 @@ test 'artist lookup with recordings and artist credits' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "♥",
},
@@ -359,7 +358,6 @@ test 'artist lookup with recordings and artist credits' => sub {
name => "BoA",
"sort-name" => "BoA",
disambiguation => "",
- ipis => [],
},
joinphrase => ""
}
@@ -378,7 +376,6 @@ test 'artist lookup with recordings and artist credits' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "♥",
},
@@ -389,7 +386,6 @@ test 'artist lookup with recordings and artist credits' => sub {
name => "BoA",
"sort-name" => "BoA",
disambiguation => "",
- ipis => [],
},
joinphrase => ""
}
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 6e338b9..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
@@ -176,7 +176,6 @@ test 'recording lookup with artists' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "♥",
},
@@ -187,7 +186,6 @@ test 'recording lookup with artists' => sub {
name => "BoA",
"sort-name" => "BoA",
disambiguation => "",
- ipis => [],
},
joinphrase => "",
}
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 029b44a..64ac4b7 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
@@ -159,7 +159,6 @@ test 'release lookup with artists + aliases' => sub {
{ "sort-name" => "えむふろう", name => "えむふろう" },
{ "sort-name" => "エムフロウ", name => "エムフロウ" },
],
- ipis => [],
}
}],
date => "2004-03-17",
@@ -196,7 +195,6 @@ test 'release lookup with labels and recordings' => sub {
"sort-name" => "rhythm zone",
disambiguation => "",
"label-code" => JSON::null,
- ipis => [],
}
}],
media => [
@@ -269,7 +267,6 @@ test 'release lookup with release-groups' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => '',
}
@@ -289,7 +286,6 @@ test 'release lookup with release-groups' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "",
}
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 26c5d94..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
@@ -94,7 +94,6 @@ test 'release group lookup with artists' => sub {
name => "Distance",
"sort-name" => "Distance",
disambiguation => "UK dubstep artist Greg Sanders",
- ipis => [],
},
joinphrase => "",
}],
@@ -122,7 +121,6 @@ test 'release group lookup with inc=artists+releases+tags+ratings' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "",
}],
@@ -166,7 +164,6 @@ test 'release group lookup with pseudo-releases' => sub {
name => "m-flo",
"sort-name" => "m-flo",
disambiguation => "",
- ipis => [],
},
joinphrase => "",
}],
-----------------------------------------------------------------------
hooks/post-receive
--
mb_server
_______________________________________________
MusicBrainz-commits mailing list
[email protected]
http://lists.musicbrainz.org/mailman/listinfo/musicbrainz-commits