On Wed Oct 13 02:55:05 2010, stepanov.michael@gmail.com wrote:
Show quoted text> Thanks a lot for the patch. IMDB recently changed design for the site. So,
> I'm fixing the module functionality now and your patch will help to
release
Show quoted text> the module sooner :)
>
The fix you put in works to a point but doesn't return consistent types
for tv episodes. Before tv series would return 'S' for kind and now
they return 'TV Series'. The part of the patch you dropped tried to
convert this back if it could.
I've attached a new patch that puts that functionality back in as well
as cleaning up the until/if blocks a little more to do better error
checking.
diff -ruN IMDB-Film-0.47.old/lib/IMDB/Film.pm IMDB-Film-0.47/lib/IMDB/Film.pm
--- IMDB-Film-0.47.old/lib/IMDB/Film.pm 2010-10-13 02:39:16.000000000 -0600
+++ IMDB-Film-0.47/lib/IMDB/Film.pm 2010-10-13 08:28:19.000000000 -0600
@@ -372,9 +372,12 @@
$self->_show_message("title: $title", 'DEBUG');
# TODO: implement parsing of TV series like ALF (TV Series 1986â1990)
- ($self->{_title}, $self->{_year}, $self->{_kind}) = $title =~ m!(.*?)\s+\((\d{4})\)(?:\s\((\w*)\))?!;
- unless($self->{_title}) {
- ($self->{_title}, $self->{_kind}, $self->{_year}) = $title =~ m!(.*?)\s+\((.*?)?\s?([0-9\-]*)\)!;
+ unless( ($self->{_title}, $self->{_year}, $self->{_kind}) = $title =~ m!(.*?)\s+\((\d{4})\)(?:\s\((\w*)\))?! ) {
+ if( ($self->{_title}, $self->{_kind}, $self->{_year}) = $title =~ m!(.*?)\s+\((.*?)?\s?([0-9\-]*)\)! ) {
+ while( my ($k, $v) = each %FILM_KIND ) {
+ $self->{_kind} = $k if $self->{_kind} =~ m{$v}i;
+ }
+ }
}
$self->{_kind} = '' unless $self->{_kind};