X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=blobdiff_plain;f=libvideosite.pm;h=ace6f81268eab5e1e73c7393e8078c8ed950e983;hb=3437127ed985ad68e716bf36d5f5f1003d0e6c4a;hp=49208019abfb2e6326e673d34824984d6e3bf1ec;hpb=fc449da24ace2ba9ec5304afaae579d9fe55e967;p=videosite.git diff --git a/libvideosite.pm b/libvideosite.pm index 4920801..ace6f81 100644 --- a/libvideosite.pm +++ b/libvideosite.pm @@ -1,3 +1,12 @@ +# library to autodownload flash videos +# +# (c) 2007-2008 by Ralf Ertzinger +# licensed under GNU GPL v2 +# +# Based on youtube.pl by Christian Garbs +# which in turn is +# based on trigger.pl by Wouter Coekaerts + package libvideosite; require Exporter; @@ -37,7 +46,8 @@ my $defaultconfig = { '_immutable' => '1', 'schemas' => {}, } - } + }, + 'config-version' => '2', }; # @@ -130,11 +140,13 @@ sub _io { my @text = @_; my $format; + @text = ('') unless(@text); + # This will define the outputprefix once, so we don't have # do do this every time. - $outputprefix //= sprintf("%svideosite: %s", + $outputprefix = sprintf("%svideosite: %s", $remote_api->{color}->('magenta'), - $remote_api->{color}->()); + $remote_api->{color}->()) unless(defined($outputprefix)); $format = $outputprefix . shift(@text); # @@ -181,8 +193,8 @@ sub _init_config_item { my $path = shift; my $value = shift; - unless($remote_api->{config_has}->($path)) { - $remote_api->{config_set}->($path, $value); + unless(_config_has($path)) { + _config_set($path, $value); } }