const {seasonEpisodeFormat} = require('../../utils/filters');

module.exports = {
  "layout": "episode",
  "tags":['episode'],
  "eleventyComputed": {
    "episode": "{{page.fileSlug | episodeNumber: episode}}",
    "image": "{{page.url}}/../image.jpg",
    "podcast": (data) => {
      return {
      "enclosureUrl": data.podcast.enclosureUrl ||`${data.site.cdn}/${seasonEpisodeFormat(null, data).toLowerCase()}.mp3`,
      "transcriptUrl": data.podcast.transcriptUrl ||`${data.site.cdn}/${seasonEpisodeFormat(null, data).toLowerCase()}.srt`,
      "title": data.podcast.title || `${seasonEpisodeFormat(null, data)}: ${data.title || "Episode " + data.episode}`,
      "image" : data.podcast.image || data.image || "{{page.url}}/../image.jpg"
    }}
  }
}