libvideosite: send "default" to remote color API for default colors instead of undef
[videosite.git] / libvideosite.pm
index 10f1e81..12fa603 100644 (file)
@@ -46,7 +46,8 @@ my $defaultconfig = {
             '_immutable' => '1',
             'schemas' => {},
         }
-    }
+    },
+    'config-version' => '2',
 };
 
 #
@@ -182,6 +183,9 @@ sub _recursive_hash_walk {
 sub _colorpair {
     my ($fg, $bg) = @_;
 
+    $fg = defined($fg)?$fg:'default';
+    $bg = defined($bg)?$bg:'default';
+
     return $remote_api->{color}->($fg, $bg);
 }
 
@@ -192,8 +196,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);
     }
 }