/[gnump3d]/gnump3d/bin/gnump3d2
ViewVC logotype

Diff of /gnump3d/bin/gnump3d2

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.42 by skx, Sun Nov 2 19:15:07 2003 UTC revision 1.43 by skx, Sun Nov 2 19:32:26 2003 UTC
# Line 2129  sub serveDirectory( $ $ ) Line 2129  sub serveDirectory( $ $ )
2129              #  The global format string the tag cache object contains is              #  The global format string the tag cache object contains is
2130              # that which is being used for display.              # that which is being used for display.
2131              #              #
             #  However here we want to get the format string the user  
             # has selected for sorting with.  
             #  
             #  This is a global change for the life of this fork - but  
             # it doesn't matter too much as this child will exit soon.  
             #  
             $tagCache->setFormatString( $sort_order );  
   
             #  
2132              # Sort the files by the given format string.              # Sort the files by the given format string.
2133              #              #
2134              my $sorter = gnump3d::sorting->new( );              my $sorter = gnump3d::sorting->new( );
# Line 2145  sub serveDirectory( $ $ ) Line 2136  sub serveDirectory( $ $ )
2136              @FULLNAMES = &sortFiles( $sort_order, @FULLNAMES );              @FULLNAMES = &sortFiles( $sort_order, @FULLNAMES );
2137    
2138              #              #
2139              # Interpolate each sorted file.              #  Here we have a list of files, referenced by complete path
2140                # stored in '@FULLNAMES' we want to create the output HTML
2141                # to display that collection of files now.
2142              #              #
2143              foreach my $key ( @FULLNAMES )              my $html = &formatFileListOutput( @FULLNAMES );
             {  
                 # Get the display text  
                 my $display = $TAGS{ $key };  
   
                 # Strip the directory name from the key now that we  
                 # have found the tags.  
                 if ( $key =~ /(.*)\/(.*)/ )  
                 {  
                     $key = $2;  
                 }  
   
                 # Modify the link if necessary.  
                 my $suffix = "";  
                 if ( $always_stream )  
                 {  
                     $suffix = ".m3u";  
                 }  
   
                 #  
                 # Build up the text to insert into the file lists.  
                 #  
                 my $link = $path . "/" . $key . $suffix;  
                 $link = &urlEncode( $link );  
   
                 my $plink= $path . "/" . $key;  
                 $plink = &urlEncode( $plink );  
   
                 #  
                 # Do the interpolation.  
                 my $output = $file_format;  
                 $output    =~ s/\$LINK/$link/g;  
                 $output    =~ s/\$PLAINLINK/$plink/g;  
                 $output    =~ s/\$SONG_FORMAT/$display/g;  
   
                 #  
                 # Add the song to the display.  
                 $total .= $output;  
                 $total .= "\n";  
2144    
2145              }              $total .= $html;
2146              $total .= $post;              $total .= $post;
2147          }          }
2148          elsif ( $line =~ /(.*)\$PLAYLISTS(.*)/ )          elsif ( $line =~ /(.*)\$PLAYLISTS(.*)/ )
# Line 2386  sub serveDirectory( $ $ ) Line 2341  sub serveDirectory( $ $ )
2341    
2342    
2343  #  #
2344    #  Format a collection of tracks for output.
2345    #
2346    sub formatFileListOutput( @ )
2347    {
2348      my ( @FILES ) = ( @_ );
2349    
2350      my $total = "";
2351    
2352      # The hash has keys of filenames, and values of the
2353      # tags to be displayed.
2354      my %TAGS = $tagCache->formatMultipleSongTags( @FILES );
2355    
2356      # Modify the link if necessary.
2357      my $suffix = "";
2358      if ( $always_stream )
2359      {
2360          $suffix = ".m3u";
2361      }
2362    
2363    
2364      #
2365      # Interpolate each given file.
2366      #
2367      foreach my $key ( @FILES )
2368      {
2369          print "KEY: $key\n";
2370          print "TAG" . $TAGS{ $key } . "\n";
2371    
2372          # Get the display text
2373          my $display = $TAGS{ $key };
2374    
2375          if ( $key =~ /^$ROOT(.*)/ )
2376          {
2377              $key = $1;
2378          }
2379    
2380          #
2381          # Build up the text to insert into the file lists.
2382          #
2383          my $link  = $key . $suffix;
2384          $link     = &urlEncode( $link );
2385    
2386          my $plink = $key;
2387          $plink    = &urlEncode( $plink );
2388    
2389          #
2390          # Do the interpolation.
2391          my $output = $file_format;
2392          $output    =~ s/\$LINK/$link/g;
2393          $output    =~ s/\$PLAINLINK/$plink/g;
2394          $output    =~ s/\$SONG_FORMAT/$display/g;
2395    
2396          #
2397          # Add the song to the display.
2398          $total .= $output;
2399          $total .= "\n";
2400    
2401        }
2402    
2403        return( $total );
2404    }
2405    #
2406  #  Format the song tags via the currently defined template string.  #  Format the song tags via the currently defined template string.
2407  #  #
2408  sub getSongDisplay( $ $ )  sub getSongDisplay( $ $ )

Legend:
Removed from v.1.42  
changed lines
  Added in v.1.43

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26