add special UNTAGGED tag when no non-special tags present
[id3fs.git] / lib / ID3FS / DB.pm
index 909d7f1..79cd194 100644 (file)
@@ -249,9 +249,16 @@ sub add
                                    { "artists_id" => $artist_id,
                                      "albums_id"  => $albums_id,
                                      "paths_id"   => $path_id });
-    for my $tag (@tags)
+    if(@tags)
     {
-       $self->add_tag($file_id, @$tag);
+       for my $tag (@tags)
+       {
+           $self->add_tag($file_id, @$tag);
+       }
+    }
+    else
+    {
+       $self->add_tag($file_id, "UNTAGGED");
     }
 
     $year="UNKNOWN" unless($self->ok($year));