From: Christian Weiske Date: Thu, 9 Nov 2017 22:47:51 +0000 (+0100) Subject: make transcoding cache configurable X-Git-Url: https://git.cweiske.de/noxon-gateway.git/commitdiff_plain/35f7eecda65c8a321e9f437ecae233e63aaf060b?hp=fa31828a09690f4e6310d23e2a61a639cf699b70 make transcoding cache configurable --- diff --git a/data/config.php.dist b/data/config.php.dist index 92b3db6..1720268 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -18,4 +18,9 @@ $clientSupport = [ 'audio/ogg' => true, ], ]; + +//if this is set, transcode caching is activated +$cacheDir = null; +//http-accessible cache dir URL +$cacheDirUrl = null; ?> diff --git a/src/mediatomb.php b/src/mediatomb.php index 532bbef..96be27c 100644 --- a/src/mediatomb.php +++ b/src/mediatomb.php @@ -68,8 +68,13 @@ function mediatombAddFile(&$listItems, $item) if (!clientSupportsType($di->mimetype)) { //client wants transcoded file //noxon iRadio cube does not want to play .ogg files - $itemUrl = $host1 . 'transcode-nocache.php' - . '?url=' . urlencode($itemUrl); + if (isset($GLOBALS['cacheDir']) && $GLOBALS['cacheDir'] != '') { + $itemUrl = $host1 . 'transcode-cache.php' + . '?url=' . urlencode($itemUrl); + } else { + $itemUrl = $host1 . 'transcode-nocache.php' + . '?url=' . urlencode($itemUrl); + } } $listItems[] = getEpisodeItem( $item->title,