make transcoding cache configurable
[noxon-gateway.git] / src / mediatomb.php
index 532bbef892ed36d7fc2adc71863907e93c713a14..96be27c0114ba8c5bd75cf79c909b5e120fa7f68 100644 (file)
@@ -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,