- if ($itemtemplate->query(name => "enclosure")) {
- my $file=$pagesources{$p};
- my $type=pagetype($file);
- if (defined $type) {
- $itemtemplate->param(content => $pcontent);
- }
- else {
- my $size=(srcfile_stat($file))[8];
- my $mime="unknown";
- eval q{use File::MimeInfo};
- if (! $@) {
- $mime = mimetype($file);
- }
- $itemtemplate->param(
- enclosure => $u,
- type => $mime,
- length => $size,
- );
+ if (exists $pagestate{$p}{meta}{enclosure}) {
+ my $absurl = $pagestate{$p}{meta}{enclosure};
+ my $file = $pagestate{$p}{meta}{enclosurefile};
+ genenclosure($itemtemplate, $absurl, $file);
+ $fancy_enclosure_seen = 1;