Curating chapter media.

This commit is contained in:
DebaucheryLibrarian 2021-02-27 03:57:37 +01:00
parent cdea877024
commit e60153ad01
1 changed files with 27 additions and 1 deletions

View File

@ -52,6 +52,28 @@ const releaseFields = `
duration duration
title title
description 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 { poster: releasesPosterByReleaseId {
media { media {
@ -170,7 +192,11 @@ function curateGraphqlRelease(release) {
entity: release.entity, entity: release.entity,
actors: release.actors.map(actor => actor.actor), actors: release.actors.map(actor => actor.actor),
tags: release.tags.map(tag => tag.tag), 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, poster: release.poster?.media || null,
...(release.photos && { photos: release.photos.map(photo => photo.media) }), ...(release.photos && { photos: release.photos.map(photo => photo.media) }),
trailer: release.trailer?.media || null, trailer: release.trailer?.media || null,