fix chat sw

This commit is contained in:
mynah
2019-03-21 18:50:06 +01:00
parent 5b10b5521f
commit 63ffc6c7d4
2 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@ package Dojo::Controller::Data;
use Mojo::File 'path';
use Mojo::JSON qw(decode_json encode_json);
use Mojo::Base 'Mojolicious::Controller';
use Dojo::Support qw{ dmph merge_hash load_module };
use Dojo::Support qw{ log };
use Net::Telnet;
my $server_name = "";
@@ -13,7 +13,6 @@ sub simple{
my $n=$c->param("dreq")//"";
my $json = {status => "304"};
$json = { srv =>$c->config->{radio_server} } if $n =~m/^radio$/ ;
$json = candy() if $n =~m/^candy$/ ;
$json = decode_json($data_path->child("$n")->slurp)
if $n=~m/^podcast\/podcast.json$/;
$c->render(json=>$json);
@@ -33,7 +32,7 @@ sub admin{
sub candy{
my $c=shift;
my $r="-1";
$server_name = $c->config->{chat_srv};
$server_name = $c->config->{chat_srv};
if (connectT()) {
$r = isOn() if ($c->param("command") =~/^isOn$/);
$r = turnOn() if ($c->param("command") =~/^on$/);