PathElement::*: implement id() method
[id3fs.git] / lib / ID3FS / PathElement / Tag.pm
index 6fc7978..3ddb659 100644 (file)
@@ -12,12 +12,13 @@ sub new
 
     $self->{db}=shift;
     $self->{name}=shift;
-    $self->{id}=($self->{db}->id("tags", $self->{name}));
+    $self->{parents_id}=shift;
+    $self->{id}=$self->{db}->lookup_id("tags", $self->{name}, $self->{parents_id});
     return(undef) unless(defined($self->{id}));
-    print "TAG ID: $self->{id}\n";
     return($self);
 }
 
 sub type { return "tag"; }
+sub id { return shift->{id}; }
 
 1;