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 {