fix podcast redirection
[noxon-gateway.git] / src / podcasts.php
index 1756ed5ad426c501568ba5f60cf90859c3017343..bb8f5ce7d675988482cbfe2a4620b216701f3f5e 100644 (file)
@@ -21,22 +21,20 @@ function sendPodcast($path)
     
     $sx = simplexml_load_file($cacheFile);
     $listItems = array();
-    addPreviousItem($listItems, $path);
 
     foreach ($sx->channel->item as $item) {
         $title = (string) $item->title;
         $desc = (string) $item->description;
         $url = $item->enclosure['url'];
 
-        $listItems[] = '<Item>'
-            . '<ItemType>ShowEpisode</ItemType>'
-            . '<ShowEpisodeName>' . utf8_decode(htmlspecialchars($title)) . '</ShowEpisodeName>'
-            . '<ShowEpisodeURL>' . $host1 . 'play-url?url=' . urlencode($url) . '</ShowEpisodeURL>'
-            . '<ShowDesc>' . utf8_decode(htmlspecialchars($desc)) . '</ShowDesc>'
-            . '<ShowMime>MP3</ShowMime>' 
-            . '</Item>';
+        $listItems[] = getEpisodeItem(
+            $title,
+            $host1 . 'deredirect.php?url=' . urlencode($url),
+            $desc,
+            'MP3'
+        );
     }
-    sendListItems($listItems);
+    sendListItems($listItems, buildPreviousItem($path));
 }