add special UNTAGGED tag when no non-special tags present
authorIan Beckwith <ianb@erislabs.net>
Sat, 30 Oct 2010 00:25:58 +0000 (01:25 +0100)
committerIan Beckwith <ianb@erislabs.net>
Sat, 30 Oct 2010 00:25:58 +0000 (01:25 +0100)
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));