fix(comicvine): update Comicvine ID handling for issues and volumes in metadata extraction (#864)

This commit is contained in:
brios
2026-04-28 17:06:55 +02:00
committed by GitHub
parent 183c688a55
commit 661672bf5b
6 changed files with 153 additions and 127 deletions
@@ -59,7 +59,7 @@ public class ComicvineBookParserTest {
HttpResponse<String> response = getResponse(statusCode, payload);
when(
httpClient.<String>send(
argThat(arg -> arg != null && arg.uri().toString().startsWith(("https://comicvine.gamespot.com/api" + uri))),
argThat(arg -> arg != null && arg.uri().toString().contains(uri)),
any()
)
).thenReturn(response);
@@ -107,17 +107,11 @@ public class ComicvineBookParserTest {
@Test
public void fetchTopMetadata_getsTitle() throws IOException, InterruptedException {
mockResponse(
"/search/?api_key=example&format=json&resources=volume,issue&query=Example&",
"/search/",
200,
readFixture("search.json")
);
mockResponse(
"/issue/4000-60593/",
200,
readFixture("issue.json")
);
Book book = getBook("EXAMPLE");
FetchMetadataRequest request = FetchMetadataRequest.builder()
.title("Example")
@@ -131,14 +125,21 @@ public class ComicvineBookParserTest {
@Test
public void fetchTopMetadata_parsesSeriesInfoFromTitle() throws IOException, InterruptedException {
// The parser first tries /search/ endpoint for volumes
mockResponse(
"/volumes/?api_key=example&format=json&filter=name:The%20Example&",
"/search/?api_key=example&format=json&resources=volume&query=The%20Example",
200,
"{\"results\": []}"
);
mockResponse(
"/volumes/?api_key=example&format=json&filter=name:The%20Example",
200,
readFixture("search.json")
);
mockResponse(
"/issues/?api_key=example&format=json&filter=volume:60593,issue_number:1&",
"/issues/?api_key=example&format=json&filter=volume:60593,issue_number:1",
200,
readFixture("issues.json")
);