fix podcast redirection
[noxon-gateway.git] / src / mediatomb.php
index 96be27c0114ba8c5bd75cf79c909b5e120fa7f68..ffc123a38f621624e365733fee172be5b8813132 100644 (file)
@@ -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,7 +73,7 @@ function mediatombAddFile(&$listItems, $item)
     if (!clientSupportsType($di->mimetype)) {
         //client wants transcoded file
         //noxon iRadio cube does not want to play .ogg files
-        if (isset($GLOBALS['cacheDir']) && $GLOBALS['cacheDir'] != '') {
+        if (isset($GLOBALS['enableCache']) && $GLOBALS['enableCache']) {
             $itemUrl = $host1 . 'transcode-cache.php'
                 . '?url=' . urlencode($itemUrl);
         } else {