diff --git a/components/bluetooth-sink-switch/README.md b/components/bluetooth-sink-switch/README.md index 572bde2a1..a0e170f8d 100644 --- a/components/bluetooth-sink-switch/README.md +++ b/components/bluetooth-sink-switch/README.md @@ -16,7 +16,7 @@ If no bluetooth device is connected, the output defaults back to speakers. After ### Limitations -This feature only works for the *Classic* Edition. Why? It relies on the mpd multiple output channels feature to switch between outputs. This is no available in mopidy, which is used in the Spotify Edition. +This feature only works for the *Classic* Edition. Why? It relies on the mpd multiple output channels feature to switch between outputs. This is not available in mopidy, which is used in the Spotify Edition. ## Installation diff --git a/htdocs/inc.processCheckCardEditRegister.php b/htdocs/inc.processCheckCardEditRegister.php index 530e9f991..7910cc164 100755 --- a/htdocs/inc.processCheckCardEditRegister.php +++ b/htdocs/inc.processCheckCardEditRegister.php @@ -109,8 +109,8 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { $messageSuccess = ""; if($post['delete'] == "delete") { - $messageAction .= "

The card with the ID '".$post['cardID']." has been deleted. - If you made a mistake, this is your chance to press 'Submit' to restore the card settings. + $messageAction .= "

The card with the ID '".$post['cardID']." has been deleted. + If you made a mistake, this is your chance to press 'Submit' to restore the card settings. Else: Go Home.

"; // remove $fileshortcuts to cardID file in shortcuts $exec = "rm ".$fileshortcuts; @@ -118,18 +118,18 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { print "
deleting shortcut:\n";
         print $exec;
         print "
"; - } + } exec($exec); } elseif($post['submit'] == "submit") { /* * error check */ - + // posted too little? if( - (!isset($post['streamURL']) || !isset($post['streamType'])) - && !isset($post['audiofolder']) - && !isset($post['YTstreamURL']) + (!isset($post['streamURL']) || !isset($post['streamType'])) + && !isset($post['audiofolder']) + && !isset($post['YTstreamURL']) && !isset($post['TriggerCommand']) ) { $messageError .= $lang['cardRegisterErrorStreamOrAudio']." (error 002)"; @@ -161,9 +161,9 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { } // streamFolderName not given - if( - (isset($post['streamURL']) || isset($post['YTstreamURL'])) - && !isset($post['audiofolder']) + if( + (isset($post['streamURL']) || isset($post['YTstreamURL'])) + && !isset($post['audiofolder']) && !isset($post['audiofolderNew']) ) { $messageError .= $lang['cardRegisterErrorSuggestFolder']." (error 006)"; @@ -172,7 +172,7 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { } //wrong spotify url, convert to mopidy format - if((isset($post['streamURL']) && $post['streamType'] == "spotify") && (strpos($post['streamURL'], "https://open.spotify.com/") !== false)){ + if((isset($post['streamURL']) && $post['streamType'] == "spotify") && (strpos($post['streamURL'], "https://open.spotify.com/") !== false)){ $patterns = array(); $patterns[0] = '/https\:\/\/open.spotify.com/'; $patterns[1] = '/\/(playlist|album|track|artist)\//'; @@ -200,7 +200,7 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { * Stream URL to be created */ // 20200512 included code from removed the old include('inc.processAddNewStream.php'); - + // create new folder $streamfolder = $Audio_Folders_Path."/".$post['audiofolderNew']."/"; $exec = "mkdir -p '".$streamfolder."'"; @@ -208,7 +208,7 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { // New folder is created so we link a RFID to it. Write $post['audiofolderNew'] to cardID file in shortcuts $exec = "rm ".$fileshortcuts."; echo '".$post['audiofolderNew']."' > ".$fileshortcuts."; chmod 777 ".$fileshortcuts; exec($exec); - + // figure out $streamfile depending on $post['streamType'] switch($post['streamType']) { case "spotify": @@ -223,7 +223,7 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { default: $streamfile = "url.txt"; } - + // write $post['streamURL'] to $streamfile and make accessible to anyone $exec = "echo '".$post['streamURL']."' > '".$streamfolder."/".$streamfile."'; sudo chmod -R 777 '".$streamfolder."'"; exec($exec); @@ -235,15 +235,15 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { * RFID triggers system commands */ // 20200512 included code from removed the old include('inc.processAddTriggerCommand.php'); - + // Replace the potential existing RFID value with the posted one //print $post['cardID']."->".$post['TriggerCommand']; $fillRfidArrAvailWithUsed[$post['TriggerCommand']] = $post['cardID']; - + /****************************************** * Create new conf file based on posted values */ - + // copy sample file to conf file exec("cp ../settings/rfid_trigger_play.conf.sample ../settings/rfid_trigger_play.conf; chmod 777 ../settings/rfid_trigger_play.conf"); // replace posted values in new conf file @@ -255,13 +255,13 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { } // success message $messageSuccess = $lang['cardRegisterTriggerSuccess']." ".$post['TriggerCommand']; - } + } elseif(isset($post['YTstreamURL'])) { /******************************************************* * YouTube Download */ // 20200512 included code from removed the old include('inc.processAddYT.php'); - + if(isset($post['audiofolderNew'])) { // create new folder $exec = "mkdir --parents '".$Audio_Folders_Path."/".$post['audiofolderNew']."'; chmod 777 '".$Audio_Folders_Path."/".$post['audiofolderNew']."'"; @@ -283,7 +283,7 @@ function fillRfidArrAvailWithUsed($rfidAvailArr, $rfidUsedArr=array()) { exec("{ ".$exec." } > /dev/null &"); // success message $messageSuccess = $lang['cardRegisterDownloadingYT']; - } + } elseif(isset($post['audiofolder']) && trim($post['audiofolder']) != "false") { /******************************************************* * connect card with existing audio folder