From e60153ad01c573c3b916f6ce1e5473c05af1352b Mon Sep 17 00:00:00 2001 From: DebaucheryLibrarian Date: Sat, 27 Feb 2021 03:57:37 +0100 Subject: [PATCH] Curating chapter media. --- src/releases.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/releases.js b/src/releases.js index e9c86310..0e4ef236 100644 --- a/src/releases.js +++ b/src/releases.js @@ -52,6 +52,28 @@ const releaseFields = ` duration title description + poster: chaptersPosterByChapterId { + media { + id + path + thumbnail + s3: isS3 + width + height + size + } + } + photos: chaptersPhotos { + media { + id + path + thumbnail + s3: isS3 + width + height + size + } + } } poster: releasesPosterByReleaseId { media { @@ -170,7 +192,11 @@ function curateGraphqlRelease(release) { entity: release.entity, actors: release.actors.map(actor => actor.actor), tags: release.tags.map(tag => tag.tag), - ...(release.chapters && { chapters: release.chapters }), + ...(release.chapters && { chapters: release.chapters.map(chapter => ({ + ...chapter, + poster: chapter.poster?.media || null, + photos: chapter.photos.map(photo => photo.media), + })) }), poster: release.poster?.media || null, ...(release.photos && { photos: release.photos.map(photo => photo.media) }), trailer: release.trailer?.media || null,