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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user