Skip to content

Commit

Permalink
Merge pull request #167 from MiczFlor/develop
Browse files Browse the repository at this point in the history
fix trackEdit.php and audiofolders
  • Loading branch information
MiczFlor authored Aug 31, 2018
2 parents fd1127f + 576bcc8 commit 97d1c27
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 60 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ A contactless jukebox for the Raspberry Pi, playing audio files, playlists, podc
*Important update news*

* **Phoniebox 1.0 released** The latest release is saving battery power on the road, replaces the audio player with `mpd` and adds *resume play* as a feature - which is not meant for toddlers but audiobook lovers (aka Phoniebox is growing up!). (2018-08-18)
* **Upgrade** if you are looking for *how to upgrade* please check out [UPGRADE.md](docs/UPGRADE.md) - and if you found out something that should go there, please create a pull request. (2018-08-30)
* **One Line Install Script** As of version 1.0 there is a much simpler install procedure: copy and paste one line into your terminal and hit *enter*. Find out more about the [one-line Phoniebox install script](docs/INSTALL-stretch.md#oneLineInstall). (2018-08-18)
* **Podcasts!** More for myself than anybody else, I guess, I added the [podcast feature for Phoniebox](docs/MANUAL.md#podcasts) (2018-05-09)

* **Bleeding edge: `develop` branch** The maintenance with a growing contributor team (kudos!) got complicated. I introduced the branch `develop` which is where all new stuff is happening before merged to `master`. (2018-08-30)
---

<a href="https://youtu.be/7GI0VdPehQI" target="_blank"><img src="docs/img/iFun-YouTube.jpg" alt="Prototype of the RFID jukebox" width="800" height="450" border="1" /></a>
Expand Down
8 changes: 5 additions & 3 deletions docs/UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ Some elements of the installation depend on the OS (like 'Jessie' vs. 'Stretch')

## Which version am I on?

As of version 0.9.4 there is a file `settings/version` containing the version number.
For future reference, I will try to break down the upgrade patches / scripts from number
to number.
There is a file `settings/version` containing the version number.

# Upgrade to Version 1.0

As of version 1.0 there is a much simpler install procedure: copy and paste one line into your terminal and hit *enter*. Find out more about the [one-line Phoniebox install script](INSTALL-stretch.md#oneLineInstall).

# Upgrade from 0.9.5 to 0.9.7
* Adding a *Settings* page in the web app to control features like 'idle shutdown' and 'max volume' and toggle systemd services
Expand Down
2 changes: 2 additions & 0 deletions htdocs/inc.header.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

// path to script folder from github repo on RPi
$conf['scripts_abs'] = realpath(getcwd().'/../scripts/');
// path to shared folder from github repo on RPi
$conf['shared_abs'] = realpath(getcwd().'/../shared/');

/*
* Vars from the settings folder
Expand Down
55 changes: 0 additions & 55 deletions htdocs/trackEdit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,6 @@
***************************************************/

/* NO CHANGES BENEATH THIS LINE ***********/
/*
* Configuration file
* Due to an initial commit with the config file 'config.php' and NOT 'config.php.sample'
* we need to check first if the config file exists (it might get erased by 'git pull').
* If it does not exist:
* a) copy sample file to config.php and give warning
* b) if sample file does not exist: throw error and die
*/
if(!file_exists("config.php")) {
if(!file_exists("config.php.sample")) {
// no config nor sample config found. die.
print "<h1>Configuration file not found</h1>
<p>The files 'config.php' and 'config.php.sample' were not found in the
directory 'htdocs'. Please download 'htdocs/config.php.sample' from the
<a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/'>online repository</a>,
copy it locally to 'htdocs/config.php' and then adjust it to fit your system.</p>";
die;
} else {
// no config but sample config found: make copy (and give warning)
if(!(copy("config.php.sample", "config.php"))) {
// sample config can not be copied. die.
print "<h1>Configuration file could not be created</h1>
<p>The file 'config.php' was not found in the
directory 'htdocs'. Attempting to create this file from 'config.php.sample'
resulted in an error. </p>
<p>
Are the folder settings correct? You could try to run the following commands
inside the folder 'RPi-Jukebox-RFID' and then reload the page:<br/>
<pre>
sudo chmod -R 775 htdocs/
sudo chgrp -R www-data htdocs/
</pre>
</p>
Alternatively, download 'htdocs/config.php.sample' from the
<a href='https://github.com/MiczFlor/RPi-Jukebox-RFID/'>online repository</a>,
copy it locally to 'htdocs/config.php' and then adjust it to fit your system.</p>";
die;
} else {
$warning = "<h4>Configuration file created</h4>
<p>The file 'config.php' was not found in the
directory 'htdocs'. A copy of the sample file 'config.php.sample' was made automatically.
If you encounter any errors, edit the newly created 'config.php'.
</p>
";
}
}
}
include("config.php");

$conf['url_abs'] = "http://".$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']; // URL to PHP_SELF

$trackDat = array();
$trackDat['metaKeys']['mp3'] = array(
Expand Down Expand Up @@ -174,11 +124,6 @@
*/

include("func.php");

// path to script folder from github repo on RPi
$conf['shared_abs'] = realpath(getcwd().'/../shared/');

/*******************************************
* URLPARAMETERS
*******************************************/
Expand Down
7 changes: 6 additions & 1 deletion scripts/installscripts/stretch-install-default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ echo "#####################################################
#
# CONFIGURE MPD
#
# MPD (Music Player Daemon) runs the audio output and must
# MPD (Music Player Daemon) runs the audio output and must
# be configured. Do it now, if you are unsure.
# (Note: can be done manually later.)
"
Expand Down Expand Up @@ -322,12 +322,17 @@ echo "#####################################################
#
# If unsure, keep it like this. If your files are somewhere
# else, you can specify the folder in the next step.
# IMPORTANT: the folder will not be created, only the path
# will be remembered. If you use a custom folder, you must
# create it.
"

read -r -p "Do you want to use the default location? [Y/n] " response
case "$response" in
[nN][oO]|[nN])
echo "Please type the absolute path here (no trailing slash)."
echo "Default would be for example:"
echo "/home/pi/RPi-Jukebox-RFID/shared/audiofolders"
read INPUT
DIRaudioFolders="$INPUT"
;;
Expand Down
Empty file added shared/audiofolders/placeholder
Empty file.

0 comments on commit 97d1c27

Please sign in to comment.