X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=videosite.pl;h=d7a549fc7c4035cf181e26e70068515cc86a663e;hb=424740b4bc310d7266236c12505787159d26613d;hp=a5123bcad3e007feeb2aeeb524e6282624573fac;hpb=225c1fd55274369afe9aa75f8798ee91c0aeac60;p=videosite.git diff --git a/videosite.pl b/videosite.pl index a5123bc..d7a549f 100644 --- a/videosite.pl +++ b/videosite.pl @@ -386,6 +386,7 @@ Supported commands: disable [modulename]: disable the usage of this module (grabbers only) reload: reload all modules (this is somewhat experimental) mode [modename]: display or set the operation mode (download/display) + connector [subcommand]: manage connectors (proxies) debug: enable debugging messages nodebug: disable debugging messages EOT @@ -432,8 +433,7 @@ sub cmd_connector { my $connconf = $conf->{'videosite'}->{'connectors'}; unless(defined($subcmd)) { - write_irssi('No subcommand given'); - return; + $subcmd = "help"; } $subcmd = lc($subcmd); @@ -480,13 +480,13 @@ sub cmd_connector { $name = lc($name); - if ($name eq 'direct') { - write_irssi("Cannot remove direct connector"); + unless (exists($connconf->{$name})) { + write_irssi("Connector does not exist"); return; } - unless (exists($connconf->{$_})) { - write_irssi("Connector does not exist"); + if (exists($connconf->{$name}->{'_immutable'})) { + write_irssi("Connector cannot be removed"); return; } @@ -510,8 +510,8 @@ sub cmd_connector { $conn = lc($conn); - if ($conn eq 'direct') { - write_irssi("Connector is not modifiable"); + if (exists($connconf->{$conn}->{'_immutable'})) { + write_irssi("Connector cannot be modified"); return; } @@ -543,8 +543,8 @@ sub cmd_connector { $conn = lc($conn); - if ($conn eq 'direct') { - write_irssi("Connector is not modifiable"); + if (exists($connconf->{$conn}->{'_immutable'})) { + write_irssi("Connector cannot be modified"); return; } @@ -562,7 +562,7 @@ sub cmd_connector { delete($connconf->{$conn}->{'schemas'}->{$schema}); } elsif ($subcmd eq 'select') { - my @connlist = @_; + my @connlist = map { lc } @_; if (scalar(@connlist) == 0) { write_irssi("No connectors given"); @@ -682,6 +682,7 @@ sub init_videosite { unless (exists($conf->{'videosite'}->{'connectors'}->{'direct'})) { $conf->{'videosite'}->{'connectors'}->{'direct'} = { 'name' => 'direct', + '_immutable' => '1', 'schemas' => {}, }; }