X-Git-Url: https://git.cweiske.de/noxon-gateway.git/blobdiff_plain/cb1f0f7b093ff79e2df4cdd90c11902bc1a693f1..4233101d0f4a9ce02d399e98ea97ceade9ce42a5:/www/index.php diff --git a/www/index.php b/www/index.php index 2a38037..8b803db 100644 --- a/www/index.php +++ b/www/index.php @@ -19,17 +19,12 @@ if (file_exists($cfgFile)) { include $cfgFile; } -if (strtolower($fullUri) == '/setupapp/radio567/asp/browsexpa/loginxml.asp?token=0') { - //initial login for "internet radio" and podcasts - //lowercase tags +if (strtolower($fullUri) == '/setupapp/radio567/asp/browsexpa/loginxml.asp?token=0' + || $fullUri == '/RadioNativeLogin.php' +) { + //initial login for "internet radio", podcasts and "my noxon" header('Content-type: text/html'); - readfile($dataDir . 'initial-login.xml'); - exit(); -} else if ($fullUri == '/RadioNativeLogin.php') { - //initial login for "My noxon" - //this one wants CamelCased tags - header('Content-type: text/html'); - readfile($dataDir . 'login-mynoxon.xml'); + readfile($dataDir . 'login-camelcase.xml'); exit(); } else if ($path == '/setupapp/radio567/asp/BrowseXPA/LoginXML.asp') { //"Internet Radio" @@ -40,7 +35,6 @@ if (strtolower($fullUri) == '/setupapp/radio567/asp/browsexpa/loginxml.asp?token } else if ($path == '/RadioNative.php') { //"My Noxon" $path = '/mynoxon/'; - $path = '/internetradio/'; } else if ($path == '/setupapp/radio567/asp/BrowseXML/FavXML.asp') { //Internet Radio Station favorites favorited on device sendMessage('Unsupported'); @@ -112,20 +106,23 @@ function sendDir($path) foreach ($entries as $entry) { $urlPath = pathEncode(substr($entry, strlen($varDir))); $ext = pathinfo($entry, PATHINFO_EXTENSION); + + $titleBase = basename($entry); + $titleBase = preg_replace('#^[0-9]+_#', '', $titleBase); if (is_dir($entry)) { ++$count; - $listItems[] = getDirItem(basename($entry), $urlPath . '/'); + $listItems[] = getDirItem($titleBase, $urlPath . '/'); } else if ($ext == 'url') { //podcast ++$count; - $listItems[] = getPodcastItem(basename($entry, '.url'), $urlPath); + $listItems[] = getPodcastItem(basename($titleBase, '.url'), $urlPath); } else if (substr($entry, -8) == '.auto.sh') { //automatically execute script while listing this directory addScriptOutput($listItems, $entry); } else if ($ext == 'txt' || $ext == 'sh') { //plain text file ++$count; - $listItems[] = getDirItem(basename($entry, '.' . $ext), $urlPath); + $listItems[] = getDirItem(basename($titleBase, '.' . $ext), $urlPath); } } if (!$count) {