From 5bcb79974dbc81073e80074f0b2ae1a4d8d02269 Mon Sep 17 00:00:00 2001 From: Christian Weiske Date: Sat, 28 Nov 2015 21:12:27 +0100 Subject: [PATCH] fix single file mode URLs --- README.rst | 21 +++++++++++++++++++++ data/config.php.dist | 5 ++++- src/mediatomb.php | 8 ++++---- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 16f71ab..8993622 100644 --- a/README.rst +++ b/README.rst @@ -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 +- Single file mode for children that want to listen to a single story + before sleeping 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. +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``: diff --git a/data/config.php.dist b/data/config.php.dist index 42936be..6728859 100644 --- a/data/config.php.dist +++ b/data/config.php.dist @@ -5,6 +5,9 @@ $mediatomb = array( 'user' => 'fixme', 'pass' => 'fixme', 'host' => 'fixme', - 'port' => '49152' + 'port' => '49152', + 'singleFileDirectories' => array( + 'internetradio/Kindergeschichten/' + ), ); ?> diff --git a/src/mediatomb.php b/src/mediatomb.php index f5c4977..bdfa4eb 100644 --- a/src/mediatomb.php +++ b/src/mediatomb.php @@ -41,7 +41,7 @@ function mediatombBrowse(Services_MediaTomb $smt, $fullPath, $prefix) 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 - addPreviousItem($listItems, $fullPath); + addPreviousItem($listItems, pathEncode($fullPath)); $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, - $fullPath . 'file-' . $item->title + pathEncode($fullPath . 'file-' . $item->title) ); } } -- 2.30.2