Changeset 1606

Show
Ignore:
Timestamp:
08/27/06 01:42:22
Author:
miyagawa
Message:

moved mime_is_enclosure to Plagger::Util. Added hack to allow .ogg as enclosure. Added an unit test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger/Plugin/Filter/FindEnclosures.pm

    r1588 r1606  
    182182 
    183183    my $mime = $type ? MIME::Type->new(type => $type) : Plagger::Util::mime_type_of( URI->new($url) ); 
    184     $mime && $mime->mediaType =~ m!^(?:audio|video|image)$!
     184    Plagger::Util::mime_is_enclosure($mime)
    185185} 
    186186 
  • trunk/plagger/lib/Plagger/Util.pm

    r1605 r1606  
    22use strict; 
    33our @ISA = qw(Exporter); 
    4 our @EXPORT_OK = qw( strip_html dumbnail decode_content extract_title load_uri mime_type_of filename_for ); 
     4our @EXPORT_OK = qw( strip_html dumbnail decode_content extract_title load_uri mime_type_of filename_for mime_is_enclosure ); 
    55 
    66use Encode (); 
     
    147147} 
    148148 
     149sub mime_is_enclosure { 
     150    my $mime = shift; 
     151    return unless $mime; 
     152    $mime->mediaType =~ m!^(?:audio|video|image)$! || $mime->type eq 'application/ogg'; 
     153} 
     154 
    149155my %entities = ( 
    150156    '&' => '&',