Fixed showing title/teaser/quote/description from data.txt, not like on index.php

This commit is contained in:
hbrain 2026-06-05 09:49:20 +02:00
parent 0a9471c10a
commit fb7afd9cf3

View file

@ -922,7 +922,9 @@ function cached_video_metadata($output, $fallback){
$cache = is_file($cacheFile) ? json_decode((string)file_get_contents($cacheFile), true) : []; $cache = is_file($cacheFile) ? json_decode((string)file_get_contents($cacheFile), true) : [];
$cached = $cache['items'][$output]['metadata'] ?? null; $cached = $cache['items'][$output]['metadata'] ?? null;
if (is_array($cached)) { if (is_array($cached)) {
foreach (['title','teaser','date','sort_date','location','quote_da','description'] as $k) if (!empty($cached[$k])) $meta[$k] = $cached[$k]; // Admin content fields must stay editable/source-of-truth from data.txt.
// Only use rendered/index metadata for the displayed date/location under the title.
foreach (['date','sort_date','location'] as $k) if (!empty($cached[$k])) $meta[$k] = $cached[$k];
} }
return $meta; return $meta;
} }