| | 162 | # Media RSS |
|---|
| | 163 | my $media_ns = "http://search.yahoo.com/mrss"; |
|---|
| | 164 | my $media = $e->{entry}->{$media_ns}->{group} || $e->{entry}; |
|---|
| | 165 | my $content = $media->{$media_ns}->{content} || []; |
|---|
| | 166 | $content = [ $content ] unless ref $content; |
|---|
| | 167 | |
|---|
| | 168 | for my $media_content (@{$content}) { |
|---|
| | 169 | my $enclosure = Plagger::Enclosure->new; |
|---|
| | 170 | $enclosure->url( URI->new($media_content->{url}) ); |
|---|
| | 171 | $enclosure->auto_set_type($media_content->{type}); |
|---|
| | 172 | $entry->add_enclosure($enclosure); |
|---|
| | 173 | } |
|---|
| | 174 | |
|---|
| | 175 | if (my $thumbnail = $media->{$media_ns}->{thumbnail}) { |
|---|
| | 176 | $entry->icon({ |
|---|
| | 177 | url => $thumbnail->{url}, |
|---|
| | 178 | width => $thumbnail->{width}, |
|---|
| | 179 | height => $thumbnail->{height}, |
|---|
| | 180 | }); |
|---|
| | 181 | } |
|---|
| | 182 | |
|---|