From 2c517144d7cc40de22d1dc7214a3a95fd870de93 Mon Sep 17 00:00:00 2001
From: Cory Dransfeldt <hi@coryd.dev>
Date: Tue, 14 Nov 2023 12:48:14 -0800
Subject: [PATCH] chore: feed tweaks

---
 cache/jsonfeed-to-mastodon-timestamp.json |  2 +-
 cache/jsonfeed-to-mastodon.json           | 11 +++++++++++
 config/feedFilters.js                     | 10 ++++++++--
 src/_data/movies.js                       |  3 ++-
 4 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/cache/jsonfeed-to-mastodon-timestamp.json b/cache/jsonfeed-to-mastodon-timestamp.json
index 4f3a9f29..85aeb9b9 100644
--- a/cache/jsonfeed-to-mastodon-timestamp.json
+++ b/cache/jsonfeed-to-mastodon-timestamp.json
@@ -1,3 +1,3 @@
 {
-  "timestamp": 1699977789529
+  "timestamp": 1699992177903
 }
\ No newline at end of file
diff --git a/cache/jsonfeed-to-mastodon.json b/cache/jsonfeed-to-mastodon.json
index 46582c6c..a347e2aa 100644
--- a/cache/jsonfeed-to-mastodon.json
+++ b/cache/jsonfeed-to-mastodon.json
@@ -7243,5 +7243,16 @@
       "https://social.lol/users/cory/statuses/111409744410391018"
     ],
     "lastTootTimestamp": 1699977789523
+  },
+  "https://jarango.com/2022/09/15/against-superficial-simplicity/": {
+    "id": "aHR0cHM6Ly9qYXJhbmdvLmNvbS8yMDIyLzA5LzE1L2FnYWluc3Qtc3VwZXJmaWNpYWwtc2ltcGxpY2l0eS8=",
+    "title": "🔗: Against Superficial Simplicity",
+    "url": "https://jarango.com/2022/09/15/against-superficial-simplicity/",
+    "content_text": "🔗: Against Superficial Simplicity #WebDev https://jarango.com/2022/09/15/against-superficial-simplicity/",
+    "date_published": "Tue, 14 Nov 2023 16:21:47 +0000",
+    "toots": [
+      "https://social.lol/users/cory/statuses/111410687363653746"
+    ],
+    "lastTootTimestamp": 1699992177896
   }
 }
\ No newline at end of file
diff --git a/config/feedFilters.js b/config/feedFilters.js
index b4cb21e6..369eb137 100644
--- a/config/feedFilters.js
+++ b/config/feedFilters.js
@@ -13,8 +13,14 @@ module.exports = {
       let excerpt = ''
 
       // set the entry excerpt
-      if (entry.description) excerpt = entry.description
-      if (entry.data?.post_excerpt) excerpt = md.render(entry.data.post_excerpt)
+      if (entry.description)
+        excerpt = entry.description.includes('p>')
+          ? entry.description
+          : `<p>${entry.description}</p>`
+      if (entry.data?.post_excerpt)
+        excerpt = md.render(entry.data.post_excerpt).includes('p>')
+          ? md.render(entry.data.post_excerpt)
+          : `<p>${md.render(entry.data.post_excerpt)}</p>`
 
       // if there's a valid entry return a normalized object
       if (entry)
diff --git a/src/_data/movies.js b/src/_data/movies.js
index be3236de..9c07f5dc 100644
--- a/src/_data/movies.js
+++ b/src/_data/movies.js
@@ -3,7 +3,7 @@ const EleventyFetch = require('@11ty/eleventy-fetch')
 module.exports = async function () {
   const TV_KEY = process.env.API_KEY_TRAKT
   const MOVIEDB_KEY = process.env.API_KEY_MOVIEDB
-  const url = 'https://api.trakt.tv/users/cdransf/history/movies?page=1&limit=30'
+  const url = 'https://api.trakt.tv/users/cdransf/history/movies?page=1&limit=6&extended=full'
   const res = EleventyFetch(url, {
     duration: '1h',
     type: 'json',
@@ -23,6 +23,7 @@ module.exports = async function () {
       url: `https://trakt.tv/movies/${item['movie']['ids']['slug']}`,
       id: item['movie']['ids']['trakt'],
       tmdbId: item['movie']['ids']['tmdb'],
+      description: item['movie']['overview'],
       type: 'movie',
     }
   })