tidy Path and Node
[id3fs.git] / lib / ID3FS / Path.pm
index 629c02a..2d96265 100644 (file)
@@ -398,7 +398,6 @@ sub sort_elements
     my ($self, @input)=@_;
     my @opstack=();
     my @output=();
-#    print "INPUT: ", join(', ', map { $_->{name}; } @input), "\n";
     while(my $thing = shift @input)
     {
        if($self->is($TYPE_TAG, $thing))
@@ -424,7 +423,6 @@ sub sort_elements
     {
        push(@output, pop(@opstack));
     }
-#    print "STACK: ", join(', ', map { $_->{name}; } @output), "\n";
     return @output;
 }
 
@@ -501,8 +499,6 @@ sub tags
     }
     my $hasvals=$self->expecting_values();
     my $parent=$self->trailing_tag_parent();
-#    print "THASVALS: $hasvals\n";
-#    print "TPARENT: ", (defined($parent)? $parent : "NO"), "\n";
     my @ids=();
     my $sql="SELECT tags.name FROM ";
     if($self->in_or())
@@ -685,23 +681,10 @@ sub tags_subselect
     my($self)=@_;
     my $hasvals=$self->expecting_values();
     my $tree=$self->{tagtree};
-    my $parent=$self->trailing_tag_parent();
-
-    my $tag=undef;
-    if($hasvals)
-    {
-       $tag=$self->trailing_tag_id();
-#      print "Trailing id: $tag\n";
-    }
-    my ($sqlclause, @joins)=(undef, ());
-    ($sqlclause, @joins) = $tree->to_sql($hasvals) if($tree);
-#    use Data::Dumper;
-#    print Dumper $tree if($tree);
-#    print "SQL(" . scalar(@joins) ."): $sqlclause\n";
+    my ($sqlclause, @joins)=$tree->to_sql($hasvals) if($tree);
     my $sql="\tSELECT fxt1.files_id FROM tags t1";
     my @crosses=();
     my @inners=();
-#    $joinsneeded++ if($tag);
     for(my $i=0; $i <= $#joins; $i++)
     {
        my $cnt=$i+1;
@@ -718,10 +701,6 @@ sub tags_subselect
     $sql .= ("\n\t" . join(" ", @crosses)) if(@crosses);
     $sql .= ("\n" . join("\n", @inners)) if(@inners);
     $sql .= "\n\tWHERE $sqlclause" if($sqlclause);
-#    if($tag)
-#    {
-#      $sql .= " AND t${joinsneeded}.parents_id='$tag'";
-#    }
     $sql .= "\n\tGROUP BY fxt1.files_id\n";
     return $sql;
 }