PathElement::*: implement id() method
[id3fs.git] / lib / ID3FS / PathElement / Album.pm
index 1a4b7d5..8eed935 100644 (file)
@@ -10,9 +10,13 @@ sub new
     my $self={};
     bless($self,$class);
 
+    $self->{db}=shift;
     $self->{name}=shift;
-
+    $self->{id}=($self->{db}->lookup_id("albums", $self->{name}));
+    return(undef) unless(defined($self->{id}));
     return $self;
 }
 
+sub type { return "album"; }
+sub id { return shift->{id}; }
 1;