Skip to content
This repository was archived by the owner on Apr 6, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/documents/graphql/schema-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ type Episode {
document: Document
}

type AudioSource {
mp3: String
aac: String
ogg: String
}

type Meta {
title: String
slug: String
Expand All @@ -42,6 +48,7 @@ type Meta {
# the id of the discussion itself
discussionId: ID
credits: JSON
audioSource: AudioSource
}

# implements FileInterface
Expand Down
10 changes: 9 additions & 1 deletion packages/documents/lib/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,18 @@ const getMeta = doc => {
}
})

const { audioSourceMp3, audioSourceAac, audioSourceOgg } = doc.content.meta
const audioSource = audioSourceMp3 || audioSourceAac || audioSourceOgg ? {
mp3: audioSourceMp3,
aac: audioSourceAac,
ogg: audioSourceOgg
} : null

doc._meta = {
...doc.content.meta,
credits,
...resolvedFields
...resolvedFields,
audioSource
}
return doc._meta
}
Expand Down
4 changes: 2 additions & 2 deletions packages/documents/lib/resolve.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const getRepoId = (url, requireQuery) => {
pathname,
query
} = parse(String(url))
if (!pathname) { //empty for mailto
if (!pathname) { // empty for mailto
return
}
const pathSegments = pathname.split('/').filter(Boolean)
Expand Down Expand Up @@ -97,7 +97,7 @@ const createUrlReplacer = (allDocuments = [], usernames = [], errors = [], urlPr
const linkedDoc = allDocuments
.find(d => d.repoId === repoId)
if (linkedDoc) {
return urlPrefix+linkedDoc.content.meta.path+searchString
return urlPrefix + linkedDoc.content.meta.path + searchString
} else {
errors.push(repoId)
}
Expand Down