|
@@ -324,7 +324,9 @@ while (1) {
|
|
|
|
|
|
|
|
# We are always either playing or paused if the display is on
|
|
# We are always either playing or paused if the display is on
|
|
|
# When we're playing "Audio" assume we are paused
|
|
# When we're playing "Audio" assume we are paused
|
|
|
- if ($files{'PLAYING'}->{'status'} && $files{'PLAYING_TYPE'}->{'status'} ne 'Audio') {
|
|
|
|
|
|
|
+ if ( (exists($files{'PLAYING'}) && $files{'PLAYING'}->{'status'})
|
|
|
|
|
+ && ((exists($files{'PLAYING_TYPE'}) && $files{'PLAYING_TYPE'}->{'status'} ne 'Audio') || !exists($files{'PLAYING_TYPE'})))
|
|
|
|
|
+ {
|
|
|
$state = 'PLAY';
|
|
$state = 'PLAY';
|
|
|
} else {
|
|
} else {
|
|
|
$state = 'PAUSE';
|
|
$state = 'PAUSE';
|
|
@@ -337,7 +339,7 @@ while (1) {
|
|
|
if ($timeSinceUpdate > $STATE_TIMEOUT) {
|
|
if ($timeSinceUpdate > $STATE_TIMEOUT) {
|
|
|
$state = 'OFF';
|
|
$state = 'OFF';
|
|
|
} elsif ($timeSinceUpdate < $STATE_TIMEOUT) {
|
|
} elsif ($timeSinceUpdate < $STATE_TIMEOUT) {
|
|
|
- if ($files{'NO_MOTION'}->{'status'}) {
|
|
|
|
|
|
|
+ if (exists($files{'NO_MOTION'}) && $files{'NO_MOTION'}->{'status'}) {
|
|
|
$state = 'OFF';
|
|
$state = 'OFF';
|
|
|
} else {
|
|
} else {
|
|
|
$state = 'MOTION';
|
|
$state = 'MOTION';
|