chore(watching-import.php): add tagline as blockquote to description when importing watching data

This commit is contained in:
Cory Dransfeldt 2025-05-01 08:30:19 -07:00
parent fc37600b8b
commit 92a3730e61
No known key found for this signature in database
3 changed files with 13 additions and 11 deletions

View file

@ -64,21 +64,24 @@ class WatchingImportHandler extends ApiHandler
private function processMedia(array $mediaData, string $mediaType): void
{
$tagline = $mediaData["tagline"] ?? null;
$overview = $mediaData["overview"] ?? null;
$description = "";
if (!empty($tagline)) $description .= "> " . trim($tagline) . "\n\n";
if (!empty($overview)) $description .= trim($overview);
$id = $mediaData["id"];
$title = $mediaType === "movie" ? $mediaData["title"] : $mediaData["name"];
$year = $mediaData["release_date"] ?? $mediaData["first_air_date"] ?? null;
$year = $year ? substr($year, 0, 4) : null;
$description = $mediaData["overview"] ?? "";
$tags = array_map(
fn($genre) => strtolower(trim($genre["name"])),
$mediaData["genres"] ?? []
);
$slug = $mediaType === "movie"
? "/watching/movies/{$id}"
: "/watching/shows/{$id}";
$payload = [
"title" => $title,
"year" => $year,
@ -86,7 +89,6 @@ class WatchingImportHandler extends ApiHandler
"tmdb_id" => $id,
"slug" => $slug,
];
$table = $mediaType === "movie" ? "movies" : "shows";
try {

10
package-lock.json generated
View file

@ -1,12 +1,12 @@
{
"name": "coryd.dev",
"version": "3.4.1",
"version": "3.4.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "coryd.dev",
"version": "3.4.1",
"version": "3.4.2",
"license": "MIT",
"dependencies": {
"html-minifier-terser": "7.2.0",
@ -1805,9 +1805,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.145",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.145.tgz",
"integrity": "sha512-pZ5EcTWRq/055MvSBgoFEyKf2i4apwfoqJbK/ak2jnFq8oHjZ+vzc3AhRcz37Xn+ZJfL58R666FLJx0YOK9yTw==",
"version": "1.5.148",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.148.tgz",
"integrity": "sha512-8uc1QXwwqayD4mblcsQYZqoi+cOc97A2XmKSBOIRbEAvbp6vrqmSYs4dHD2qVygUgn7Mi0qdKgPaJ9WC8cv63A==",
"dev": true,
"license": "ISC"
},

View file

@ -1,6 +1,6 @@
{
"name": "coryd.dev",
"version": "3.4.1",
"version": "3.4.2",
"description": "The source for my personal site. Built using 11ty (and other tools).",
"type": "module",
"engines": {