Changeset 127

Show
Ignore:
Timestamp:
05/29/06 21:31:26 (2 years ago)
Author:
miya
Message:

Aggregator::Simple Support for Media RSS thumbnail.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plagger/trunk/lib/Plagger/Plugin/Aggregator/Simple.pm

    r126 r127  
    159159                   || $e->{entry}->{media}->{group}->{media}->{content}; 
    160160 
     161        my $thumbnail = $e->{entry}->{media}->{thumbnail} 
     162                     || $e->{entry}->{media}->{group}->{media}->{thumbnail}; 
     163 
    161164        if ( ref($content) eq 'ARRAY' ){ 
    162             for (@$content){ 
    163                 $self->_add_enclosure($entry, $_); 
     165            for ( @$content ){ 
     166                $self->_add_enclosure($entry, $_, $thumbnail); 
    164167            } 
    165168        } 
    166169        elsif ( $content ){ 
    167             $self->_add_enclosure($entry, $content); 
     170            $self->_add_enclosure($entry, $content, $thumbnail); 
    168171        } 
    169172 
     
    190193 
    191194sub _add_enclosure { 
    192     my ($self, $entry, $content) = @_; 
     195    my ($self, $entry, $content, $thumbnail) = @_; 
     196 
     197    $entry->icon({ 
     198        url    => $thumbnail->{url}, 
     199        width  => $thumbnail->{width}, 
     200        height => $thumbnail->{height}, 
     201    }); 
    193202 
    194203    my $enclosure = Plagger::Enclosure->new;