Changeset 2009

Show
Ignore:
Timestamp:
02/08/08 23:11:24
Author:
typester
Message:
  • set_columns doesn't care inflate_column, so set value via inflate_column accessor directly
  • set feed->id as feedlink unless feed->url exist
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/fastladder-crawler/plagger/lib/Plagger/Plugin/Store/Fastladder.pm

    r2008 r2009  
    4747    my $now  = Plagger::Date->now; 
    4848 
    49     my $feed = $self->rs('Feeds')->find_or_new({ feedlink => $args->{feed}->url }); 
     49    my $feed = $self->rs('Feeds')->find_or_new({ feedlink => $args->{feed}->url || $args->{feed}->id }); 
    5050 
    5151    # update feed 
     
    5454        title       => $args->{feed}->title || '', 
    5555        description => $args->{feed}->description || '', 
    56         updated_on  => $args->{feed}->updated || $now, 
    5756    }); 
    58  
     57    $feed->updated_on( $args->{feed}->updated || $now ); 
    5958    $feed->created_on( $now ) unless $feed->in_storage; 
    6059    $feed->insert_or_update; 
     
    9190            enclosure      => $entry->has_enclosure ? $entry->enclosure->url : undef, 
    9291            enclosure_type => $entry->has_enclosure ? $entry->enclosure->type : undef, 
    93             created_on     => $entry->date || $now, 
    94             modified_on    => $entry->date || $now, 
    95             stored_on      => $now, 
    9692        }); 
     93        $item->created_on( $entry->date || $now ); 
     94        $item->modified_on( $entry->date || $now ); 
     95        $item->stored_on( $now ); 
    9796        $item->updated_on( $now ) if $item->is_changed; 
    9897 
     
    107106    # update status 
    108107    my $status = $self->rs('CrawlStatuses')->find_or_new({ feed_id => $feed->id }); 
    109     $status->set_columns({ 
    110         http_status => '200', 
    111         crawled_on  => $now, 
    112     }); 
     108    $status->http_status(200); 
     109    $status->crawled_on( $now ); 
    113110    $status->created_on( $now ) unless $status->in_storage; 
    114111    $status->updated_on( $now ) if $status->is_changed;