X-Git-Url: https://git.cweiske.de/noxon-gateway.git/blobdiff_plain/fa31828a09690f4e6310d23e2a61a639cf699b70..9967c9b7ad14516a95a5c408bc06e78bc2eeb75e:/src/mediatomb.php diff --git a/src/mediatomb.php b/src/mediatomb.php index 532bbef..33b9bd8 100644 --- a/src/mediatomb.php +++ b/src/mediatomb.php @@ -25,6 +25,11 @@ function mediatombBrowse(Services_MediaTomb $smt, $fullPath, $prefix) $path = substr($fullPath, strlen($prefix)); $container = $smt->getContainerByPath($path); + if ($container === null) { + sendMessage('Error accessing ' . $fullPath); + return; + } + $listItems = array(); $it = $container->getItemIterator(false); @@ -68,8 +73,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,