1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-14 01:15:56 +00:00

add DiskCache.getUrl() and use it in a bunch of places

This commit is contained in:
Andrew Dolgov
2019-08-13 12:39:21 +03:00
parent 7602819b98
commit b1dd38f880
4 changed files with 7 additions and 16 deletions

View File

@@ -1258,20 +1258,7 @@
if (file_exists($cached_filename)) {
// this is strictly cosmetic
if ($entry->tagName == 'img') {
$suffix = ".png";
} else if ($entry->parentNode && $entry->parentNode->tagName == "picture") {
$suffix = ".png";
} else if ($entry->parentNode && $entry->parentNode->tagName == "video") {
$suffix = ".mp4";
} else if ($entry->parentNode && $entry->parentNode->tagName == "audio") {
$suffix = ".ogg";
} else {
$suffix = "";
}
$src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src) . $suffix;
$src = DiskCache::getUrl(sha1($src));
if ($entry->hasAttribute('poster'))
$entry->setAttribute('poster', $src);