libvideosite: use internal _colorpair helper function
authorRalf Ertzinger <ralf@skytale.net>
Tue, 30 Apr 2013 17:20:23 +0000 (19:20 +0200)
committerRalf Ertzinger <ralf@skytale.net>
Tue, 30 Apr 2013 17:20:23 +0000 (19:20 +0200)
libvideosite.pm

index 12fa603..4252338 100644 (file)
@@ -145,8 +145,8 @@ sub _io {
     # This will define the outputprefix once, so we don't have
     # do do this every time.
     $outputprefix = sprintf("%svideosite: %s",
     # This will define the outputprefix once, so we don't have
     # do do this every time.
     $outputprefix = sprintf("%svideosite: %s",
-        $remote_api->{color}->('magenta'),
-        $remote_api->{color}->()) unless(defined($outputprefix));
+        _colorpair('magenta'),
+        _colorpair()) unless(defined($outputprefix));
     $format = $outputprefix . shift(@text);
 
     #
     $format = $outputprefix . shift(@text);
 
     #
@@ -1002,32 +1002,32 @@ sub check_for_link {
             if ('download' eq _config_get(['mode'])) {
                 _io(
                     sprintf('%s>>> %sSaving %s%%s%s %s%%s',
             if ('download' eq _config_get(['mode'])) {
                 _io(
                     sprintf('%s>>> %sSaving %s%%s%s %s%%s',
-                        $remote_api->{color}->('*red'),
-                        $remote_api->{color}->(),
-                        $remote_api->{color}->('*yellow'),
-                        $remote_api->{color}->(),
-                        $remote_api->{color}->('*green'),
+                        _colorpair('*red'),
+                        _colorpair(),
+                        _colorpair('*yellow'),
+                        _colorpair(),
+                        _colorpair('*green'),
                     ),
                     $m->{'SOURCE'},
                     $m->{'TITLE'}
                 );
                 unless($getter->get($m)) {
                     ),
                     $m->{'SOURCE'},
                     $m->{'TITLE'}
                 );
                 unless($getter->get($m)) {
-                    _io(sprintf('%s>>> FAILED', $remote_api->{color}->('*red')));
+                    _io(sprintf('%s>>> FAILED', _colorpair('*red')));
                 }
             } elsif ('display' eq _config_get(['mode'])) {
                 _io(
                     sprintf('%s>>> %sSaw %s%%s%s %s%%s',
                 }
             } elsif ('display' eq _config_get(['mode'])) {
                 _io(
                     sprintf('%s>>> %sSaw %s%%s%s %s%%s',
-                        $remote_api->{color}->('*magenta'),
-                        $remote_api->{color}->(),
-                        $remote_api->{color}->('*yellow'),
-                        $remote_api->{color}->(),
-                        $remote_api->{color}->('*green')
+                        _colorpair('*magenta'),
+                        _colorpair(),
+                        _colorpair('*yellow'),
+                        _colorpair(),
+                        _colorpair('*green')
                     ),
                     $m->{'SOURCE'},
                     $m->{'TITLE'}
                 );
             } else {
                     ),
                     $m->{'SOURCE'},
                     $m->{'TITLE'}
                 );
             } else {
-                _io(sprintf('%s>>> Invalid operation mode', $remote_api->{color}->('*red')));
+                _io(sprintf('%s>>> Invalid operation mode', _colorpair('*red')));
             }
 
             # Remove the matched part from the message and try again (there may be
             }
 
             # Remove the matched part from the message and try again (there may be