Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ws-json-fixes: Only output existent iso code properties in /ws/2/area JSON Hyphenate iso_3166_x_codes in /ws/2/area JSON Remove most PUID support from /ws/2 Implement /ws/2/isrc/?fmt=json (MBS-7921) Distinguish non-existent and not-loaded relationships (MBS-8746) Output 'target-type' in /ws/2 relationship JSON (MBS-5676) Replace is_json with cmp_deeply inc=recordings should imply inc=media (MBS-8367) Output 'ordering-key' in /ws/2 relationship JSON (MBS-8396) Return 'video' as a boolean in /ws/2/recording JSON (MBS-7735) Force numeric context on recording length
- Loading branch information
Showing
38 changed files
with
626 additions
and
506 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -188,6 +188,9 @@ sub _load | |
} | ||
} | ||
} | ||
for my $obj (@objs) { | ||
$obj->has_loaded_relationships(1); | ||
} | ||
return @rels; | ||
} | ||
|
||
|
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
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
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
30 changes: 30 additions & 0 deletions
30
lib/MusicBrainz/Server/WebService/Serializer/JSON/2/ISRC.pm
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package MusicBrainz::Server::WebService::Serializer::JSON::2::ISRC; | ||
|
||
use Moose; | ||
use MusicBrainz::Server::WebService::Serializer::JSON::2::Utils qw( serialize_entity ); | ||
|
||
extends 'MusicBrainz::Server::WebService::Serializer::JSON::2'; | ||
|
||
sub serialize { | ||
my ($self, $isrcs, $inc, $stash) = @_; | ||
|
||
return { | ||
isrc => $isrcs->[0]->name, | ||
recordings => [map { serialize_entity($_->recording, $inc, $stash) } @$isrcs], | ||
}; | ||
}; | ||
|
||
__PACKAGE__->meta->make_immutable; | ||
|
||
no Moose; | ||
|
||
1; | ||
|
||
=head1 COPYRIGHT | ||
This file is part of MusicBrainz, the open internet music database. | ||
Copyright (C) 2016 MetaBrainz Foundation | ||
Licensed under the GPL version 2, or (at your option) any later version: | ||
http://www.gnu.org/licenses/gpl-2.0.txt | ||
=cut |
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
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
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
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
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
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
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
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
Oops, something went wrong.