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

Diff of /gnump3d/bin/gnump3d2

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

revision 1.27 by skx, Thu Oct 23 10:15:10 2003 UTC revision 1.28 by skx, Mon Oct 27 14:36:37 2003 UTC
# Line 53  use gnump3d::base64;       # For decodin Line 53  use gnump3d::base64;       # For decodin
53  use gnump3d::config;       # My configuration file reading module.  use gnump3d::config;       # My configuration file reading module.
54  use gnump3d::files;        # My routines for working with files and dirs.  use gnump3d::files;        # My routines for working with files and dirs.
55  use gnump3d::lang::lookup; # Multilingual text translations.  use gnump3d::lang::lookup; # Multilingual text translations.
56  use gnump3d::playlist;     # My playlist generating code.  use gnump3d::sorting;      # Global sorting functions.
57  use gnump3d::tagcache;     # Access to the tag cache.  use gnump3d::tagcache;     # Access to the tag cache.
58  use gnump3d::IP;           # Local copy of NetAddr::IP.  use gnump3d::IP;           # Local copy of NetAddr::IP.
59  use gnump3d::url;          # URL encoding and decoding  use gnump3d::url;          # URL encoding and decoding
# Line 1749  sub serveDirectory( $ $ ) Line 1749  sub serveDirectory( $ $ )
1749          $song_format= &getConfig( "song_format", $song_format );          $song_format= &getConfig( "song_format", $song_format );
1750          $play_rec   = &getConfig( "play_recursively_text", $play_rec );          $play_rec   = &getConfig( "play_recursively_text", $play_rec );
1751          $sort_order = &getConfig( "sort_order", $sort_order );          $sort_order = &getConfig( "sort_order", $sort_order );
         print "Read sort order from configuration file : $sort_order\n";  
1752      }      }
1753    
1754      #      #
# Line 1829  sub serveDirectory( $ $ ) Line 1828  sub serveDirectory( $ $ )
1828              # Find all the subdirs.              # Find all the subdirs.
1829              #              #
1830              my @files = &dirsInDir( $dir );              my @files = &dirsInDir( $dir );
1831              @files    = sort {uc($a) cmp uc($b)} @files;              @files    = &sortDirectories( @files );
1832    
1833              foreach my $file (@files)              foreach my $file (@files)
1834              {              {
# Line 2036  sub serveDirectory( $ $ ) Line 2035  sub serveDirectory( $ $ )
2035              $tagCache->setFormatString( $sort_order );              $tagCache->setFormatString( $sort_order );
2036    
2037              #              #
2038              # Sort numerically if the sort order includes '$TRACK'.              # Sort the files by the given format string.
2039              #              #
2040              if ( $sort_order =~ /\$TRACK/ )              my $sorter = gnump3d::sorting->new( );
2041              {              $sorter->setTagCache( $tagCache );
2042                @FULLNAMES = sort{ my $one = getSongDisplay( $a, $sort_order );              @FULLNAMES = &sortFiles( $sort_order, @FULLNAMES );
                                  my $two = getSongDisplay( $b, $sort_order );  
                                  return( $one <=> $two ); } @FULLNAMES;  
             }  
             else  
             {  
               @FULLNAMES = sort{ my $one = getSongDisplay( $a, $sort_order );  
                                  my $two = getSongDisplay( $b, $sort_order );  
                                  return( $one cmp $two ); } @FULLNAMES;  
             }  
2043    
2044              #              #
2045              # Interpolate each sorted file.              # Interpolate each sorted file.

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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