fix single file mode URLs
authorChristian Weiske <cweiske@cweiske.de>
Sat, 28 Nov 2015 20:12:27 +0000 (21:12 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Sat, 28 Nov 2015 20:12:27 +0000 (21:12 +0100)
README.rst
data/config.php.dist
src/mediatomb.php

index 16f71ab30e2c8638433fb4c948485cc569389a0e..89936224cf40568f68c0f4d000253100ec67bccf 100644 (file)
@@ -25,6 +25,8 @@ Features
 - Podcast RSS feed support
 - Discoverable with your web browser
 - Transcoding of non-mp3 file types to ``.mp3`` that iRadios can play
 - Podcast RSS feed support
 - Discoverable with your web browser
 - Transcoding of non-mp3 file types to ``.mp3`` that iRadios can play
+- Single file mode for children that want to listen to a single story
+  before sleeping
 
 
 RSS feed support
 
 
 RSS feed support
@@ -55,6 +57,25 @@ When accessing the "Podcasts" menu from your noxon iRadio, you'll see a
 directory ``Cast News`` that contains all podcast episodes.
 
 
 directory ``Cast News`` that contains all podcast episodes.
 
 
+Single file mode
+----------------
+Your kid only wants to listen to this one single story before sleeping.
+You start it, set the 15 minute sleep timer and leave the room.
+
+After 15 minutes the child comes out and complains that the radio switched
+off within the second story and it wants to hear it to the end.
+
+To get around such issues, you can enable "single file directories"
+for certain folders.
+
+Each folder with audio files within this configured paths have a special
+directory "Einzeln" (single), which have separate folders for each audio
+file. Each of this separate folders only have the single audio file in them.
+
+When playing this file, the iRadio will stop playing after the one file
+is over.
+
+
 Supported radios
 ================
 This is the list of iRadios known to work with ``noxon-gateway``:
 Supported radios
 ================
 This is the list of iRadios known to work with ``noxon-gateway``:
index 42936beced2367bf6b9655bc94908ccbd4b63be9..67288599d1df8f95a057b8bf2ba78f8717f07d3f 100644 (file)
@@ -5,6 +5,9 @@ $mediatomb = array(
     'user' => 'fixme',
     'pass' => 'fixme',
     'host' => 'fixme',
     'user' => 'fixme',
     'pass' => 'fixme',
     'host' => 'fixme',
-    'port' => '49152'
+    'port' => '49152',
+    'singleFileDirectories' => array(
+        'internetradio/Kindergeschichten/'
+    ),
 );
 ?>
 );
 ?>
index f5c49777687035e1c343832ae2160cadd3177127..bdfa4ebae10d290b64af01944b4e9deb964ffc82 100644 (file)
@@ -41,7 +41,7 @@ function mediatombBrowse(Services_MediaTomb $smt, $fullPath, $prefix)
         if ($enableSingle) {
             $listItems[] = getDirItem(
                 'Einzeln',
         if ($enableSingle) {
             $listItems[] = getDirItem(
                 'Einzeln',
-                '.mt-single/' . $path
+                pathEncode('.mt-single/' . $path)
             );
         }
     }
             );
         }
     }
@@ -106,17 +106,17 @@ function mediatombSingle(Services_MediaTomb $smt, $fullPath, $prefix)
 
     if ($fileMode) {
         //show single file to play
 
     if ($fileMode) {
         //show single file to play
-        addPreviousItem($listItems, $fullPath);
+        addPreviousItem($listItems, pathEncode($fullPath));
         $item = $smt->getSingleItem($container, $fileTitle, false);
         mediatombAddFile($listItems, $item);
     } else {
         $item = $smt->getSingleItem($container, $fileTitle, false);
         mediatombAddFile($listItems, $item);
     } else {
-        addPreviousItem($listItems, 'internetradio/' . $path . '/dummy');
+        addPreviousItem($listItems, pathEncode('internetradio/' . $path . '/dummy'));
 
         //browse directory
         foreach ($container->getItemIterator(false) as $item) {
             $listItems[] = getDirItem(
                 $item->title,
 
         //browse directory
         foreach ($container->getItemIterator(false) as $item) {
             $listItems[] = getDirItem(
                 $item->title,
-                $fullPath . 'file-' . $item->title
+                pathEncode($fullPath . 'file-' . $item->title)
             );
         }
     }
             );
         }
     }