mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-16 06:25:57 +00:00
allow caching of audio files
This commit is contained in:
@@ -909,15 +909,10 @@
|
|||||||
|
|
||||||
if ($entry->hasAttribute('src')) {
|
if ($entry->hasAttribute('src')) {
|
||||||
$src = rewrite_relative_url($rewrite_base_url, $entry->getAttribute('src'));
|
$src = rewrite_relative_url($rewrite_base_url, $entry->getAttribute('src'));
|
||||||
|
|
||||||
// check cache only for video and images for the time being
|
|
||||||
if ($entry->nodeName == 'img' || ($entry->parentNode && $entry->parentNode->nodeName == "video")) {
|
|
||||||
|
|
||||||
$cached_filename = CACHE_DIR . '/images/' . sha1($src);
|
$cached_filename = CACHE_DIR . '/images/' . sha1($src);
|
||||||
$extension = $entry->tagName == 'source' ? '.mp4' : '.png';
|
|
||||||
|
|
||||||
if (file_exists($cached_filename)) {
|
if (file_exists($cached_filename)) {
|
||||||
$src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src) . $extension;
|
$src = get_self_url_prefix() . '/public.php?op=cached_url&hash=' . sha1($src);
|
||||||
|
|
||||||
if ($entry->hasAttribute('srcset')) {
|
if ($entry->hasAttribute('srcset')) {
|
||||||
$entry->removeAttribute('srcset');
|
$entry->removeAttribute('srcset');
|
||||||
@@ -927,7 +922,6 @@
|
|||||||
$entry->removeAttribute('sizes');
|
$entry->removeAttribute('sizes');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$entry->setAttribute('src', $src);
|
$entry->setAttribute('src', $src);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user