diff --git a/lib/Dojo.pm b/lib/Dojo.pm index fe54e20..107ab65 100755 --- a/lib/Dojo.pm +++ b/lib/Dojo.pm @@ -30,15 +30,16 @@ use Dojo::Model::Users; $r->any('/tst')->to('home#tst'); # ============================================================================= -# json ======================================================================== - $r->any('/json/*dreq')->to('data#simple'); -# ============================================================================= # candy ======================================================================= $r->any('/json/candy/:command')->to('data#candy'); $r->any('/candy')->to('home#candy'); # ============================================================================= +# json ======================================================================== + $r->any('/json/*dreq')->to('data#simple'); +# ============================================================================= + # register user =============================================================== $r->any('/reg')->to('users#reg'); # ============================================================================= diff --git a/lib/Dojo/Controller/Data.pm b/lib/Dojo/Controller/Data.pm index 73f2aa0..c56b0a2 100755 --- a/lib/Dojo/Controller/Data.pm +++ b/lib/Dojo/Controller/Data.pm @@ -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$/);