Skip to content

Commit

Permalink
Now adding the author keywords/labels/tags for each distribution.
Browse files Browse the repository at this point in the history
See the comments and the todos.
  • Loading branch information
shlomif committed Jun 27, 2009
1 parent 4dcf032 commit 65d7135
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions lib/CPANHQ/Storage/Release.pm
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,24 @@ sub _process_meta_yml {
}
}

if (defined(my $keywords = $meta_yml->{'keywords'})) {
# Doing it in a pretty dumb and not-so-DBIx-Class-y way now
# until I figure out a better way to do it, if one exists.
# TODO : Delete all the previous author-tags.
foreach my $tag_string (@$keywords)
{
my $tag = $self->result_source->schema->resultset('Keyword')
->find_or_create({string_id => $tag_string})
;

$self->result_source->schema
->resultset('AuthorDistributionKeyword')
->new({distribution => $self->distribution(), keyword => $tag})
->insert()
;
}
}

$self->update();

return;
Expand Down

0 comments on commit 65d7135

Please sign in to comment.