From c1d68e034f5c5fb8e767c84742195acc6381e5a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Fri, 19 Jul 2024 18:20:17 +0200 Subject: [PATCH] [WIP] MBS-6741: Include area containment in WS responses This is a small start that currently fails because the area objects loaded by load_containment and load_subset are different. mwiencek is supposed to have a patch for that somewhere which might unlock further progress here. --- lib/MusicBrainz/Server/Controller/WS/2/Artist.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/MusicBrainz/Server/Controller/WS/2/Artist.pm b/lib/MusicBrainz/Server/Controller/WS/2/Artist.pm index 10dbf87a844..5bc1ce13f3e 100644 --- a/lib/MusicBrainz/Server/Controller/WS/2/Artist.pm +++ b/lib/MusicBrainz/Server/Controller/WS/2/Artist.pm @@ -59,6 +59,13 @@ sub artist_toplevel $c->model('ArtistType')->load(@artists); $c->model('Gender')->load(@artists); $c->model('Area')->load(@artists); + $c->model('Area')->load_containment(map { $_->{area} } @artists); + $c->model('Relationship')->load_subset(['area'], map { @{ $_->area->containment } } @artists); + $c->model('Area')->load_containment(map { $_->{begin_area} } @artists); + $c->model('Relationship')->load_subset(['area'], map { $_->{begin_area} } @artists); + $c->model('Relationship')->load_subset(['area'], map { @{ $_->begin_area->containment } } @artists); + $c->model('Area')->load_containment(map { $_->{end_area} } @artists); + #$c->model('Relationship')->load_subset(['area'], map { @{ $_->end_area->containment } } @artists); $c->model('Artist')->ipi->load_for(@artists); $c->model('Artist')->isni->load_for(@artists);