Apache-MP3
view release on metacpan or search on metacpan
}
}
# top level for directory display
sub list_directory {
my $self = shift;
my $dir = shift;
return DECLINED unless -d $dir;
my $last_modified = (stat(_))[9];
$self->r->headers_out->add('ETag' => sprintf("%lx-%s", $last_modified, $VERSION));
if (my $check = $self->r->headers_in->{"If-None-Match"}) {
my ($time, $ver) = $check =~ /^([a-f0-9]+)-([0-9.]+)$/;
if ($check eq '*' or (hex($time) == $last_modified and $ver == $VERSION)) {
return HTTP_NOT_MODIFIED;
}
}
if (substr($subdir, -1) eq "/") {
chop $subdir;
$subdirpath = $self->r->lookup_uri($subdir)->filename;
}
my $nb = ' ';
(my $title = $subdir) =~ s/\s/$nb/og; # replace whitespace with
$title =~ s!^.*(/[^/]+/[^/]+)$!...$1!; # if dir is fully pathed, only keep 2 parts for title
my $uri = escape($subdir);
my $result;
my($atime,$mtime) = (stat($subdirpath))[8,9];
my($last,$times);
if($self->r->dir_config('CacheStats')){
($last,$times) = $self->stats($self->r->filename,$subdir);
}
if($self->subdir_columns == 1){
$result = td(
a({-href=>$uri.'/playlist.m3u?Play+All+Recursive=1'},
img({-src=>$self->cd_list_icon($subdir),
( run in 0.952 second using v1.01-cache-2.11-cpan-49f99fa48dc )