Changeset 293
- Timestamp:
- 10/01/06 22:54:39 (2 years ago)
- Files:
-
- plagger/trunk/lib/Plagger/Entry.pm (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plagger/trunk/lib/Plagger/Entry.pm
r291 r293 3 3 4 4 use base qw( Plagger::Thing ); 5 __PACKAGE__->mk_accessors(qw( title author tags link feed_link idsummary body rate icon meta source ));5 __PACKAGE__->mk_accessors(qw( title author tags link feed_link summary body rate icon meta source )); 6 6 __PACKAGE__->mk_date_accessors(qw( date )); 7 7 … … 19 19 meta => {}, 20 20 enclosures => [], 21 events => [],22 21 }, $class; 23 22 } … … 49 48 } 50 49 50 sub id { 51 my $self = shift; 52 $self->{id} = shift if @_; 53 $self->{id} || $self->permalink || do { 54 my $id = $self->feed_link; 55 $id .= $self->date ? $self->date->epoch : $self->title; 56 $id; 57 }; 58 } 59 51 60 sub id_safe { 52 61 my $self = shift; 53 my $id = $self->id || $self->permalink; 54 55 # entry without id or permalink. Try entry's date or title 56 unless ($id) { 57 $id = $self->feed_link; 58 $id .= $self->date ? $self->date->epoch : $self->title; 59 } 60 61 $id =~ m!^https?://! ? Digest::MD5::md5_hex($id) : $id; 62 Plagger::Util::safe_id($self->id); 62 63 } 63 64 … … 124 125 125 126 1; 127
