Skip Menu |

This queue is for tickets about the IMDB-Film CPAN distribution.

Report information
The Basics
Id: 51240
Status: resolved
Priority: 0/
Queue: IMDB-Film

People
Owner: Nobody in particular
Requestors: gerph [...] gerph.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.42
Fixed in: (no value)



Subject: $film->plot() returning invalid results
Hiya, Simple one to show: my ($film, $year) = ('Freaky Friday', 1995); print "Test '$film' ($year)\n"; my $imdb = new IMDB::Film(crit => $film, year => $year, cache => 1); $plot = $imdb->plot(); $fullplot= $imdb->full_plot(); print "PLOT:\n"; print " $plot\n"; print "FULLPLOT:\n"; print " $fullplot\n"; Writes the 'PLOT' as the value of the keywords - "Remake | Child As Adult | Role Reversal | Mother Daughter Relationship | Sports Team". My fix is to change the code so that the while in sub plot reads: while(my $tag = $parser->get_tag(MAIN_TAG)) { last if $parser->get_text =~ /^plot(?! keywords)/i; } (?!...) is a zero-width negative look-ahead assertion. Might be easier to say eq 'Plot:', but I felt this was more in keeping with how the code was used. However, the change that was made in 0.41->0.42 to support references to other links means that we also have other values. Apply the above change and change the film initialisation line to: my ($film, $year) = ('Freaky Friday', 2003); and we now get: PLOT: An overworked mother and her daughter do not get along. When they switch bodies, each is forced to adapt to the others life for one freaky Friday. full summary | add synopsis ... because the full summary and bits appear as links on the end of the text. If the line in sub plot is changed to: $plot =~ s/\s+full summary \| (full|add) synopsis//; then this appears to strip them quite happily.
On Mon Nov 09 12:16:00 2009, gerph wrote: Show quoted text
> ... because the full summary and bits appear as links on the end of
the Show quoted text
> text. If the line in sub plot is changed to: > > $plot =~ s/\s+full summary \| (full|add) synopsis//; > > then this appears to strip them quite happily.
Looks like I spoke to soon on this. Using: my ($film, $year) = ("The Bravados", 1958); results in: PLOT: Jim Douglas has been relentlessly pursuing the four outlaws who murdered his wife, but finds them in jail about to be hanged... more | add synopsis so probably a better regular expression would be: $plot =~ s/\s+(full summary|more) \| (full|add) synopsis//;
Subject: Re: [rt.cpan.org #51240] $film->plot() returning invalid results
Date: Wed, 11 Nov 2009 12:16:05 +0200
To: bug-IMDB-Film [...] rt.cpan.org
From: Michael Stepanov <stepanov.michael [...] gmail.com>
Hi Justing, Thanks for the bugreport. I tested all cases you sent me. The function retrieved plot will be fixed to avoid retrieving plot keywords instead. But the issue with displaying "more | add synopsis" is already fixed in 0.42 (at least I got clear plot without those). On Mon, Nov 9, 2009 at 7:39 PM, Justin Fletcher via RT < bug-IMDB-Film@rt.cpan.org> wrote: Show quoted text
> Queue: IMDB-Film > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=51240 > > > On Mon Nov 09 12:16:00 2009, gerph wrote:
> > ... because the full summary and bits appear as links on the end of
> the
> > text. If the line in sub plot is changed to: > > > > $plot =~ s/\s+full summary \| (full|add) synopsis//; > > > > then this appears to strip them quite happily.
> > Looks like I spoke to soon on this. Using: > > my ($film, $year) = ("The Bravados", 1958); > > results in: > > PLOT: > Jim Douglas has been relentlessly pursuing the four outlaws who > murdered his wife, but finds them in jail about to be hanged... more | > add synopsis > > so probably a better regular expression would be: > > $plot =~ s/\s+(full summary|more) \| (full|add) synopsis//; > > >
-- Best regards, Michael Stepanov, http://linuxmce.ru
Subject: Re: [rt.cpan.org #51240] $film->plot() returning invalid results
Date: Wed, 11 Nov 2009 14:24:37 +0000 (GMT)
To: Michael Stepanov via RT <bug-IMDB-Film [...] rt.cpan.org>
From: Justin Fletcher <gerph [...] gerph.org>
On Wed, 11 Nov 2009, Michael Stepanov via RT wrote: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=51240 > > > Hi Justing, > > Thanks for the bugreport. I tested all cases you sent me. The function > retrieved plot will be fixed to avoid retrieving plot keywords instead. But > the issue with displaying "more | add synopsis" is already fixed in 0.42 (at > least I got clear plot without those).
Strange; I definitely saw that and couldn't see how it could be avoided, but if you're not seeing it then it might be something peculiar to my setup. Thanks for having a look at that :-) Show quoted text
> On Mon, Nov 9, 2009 at 7:39 PM, Justin Fletcher via RT < > bug-IMDB-Film@rt.cpan.org> wrote: >
>> Queue: IMDB-Film >> Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=51240 > >> >> On Mon Nov 09 12:16:00 2009, gerph wrote:
>>> ... because the full summary and bits appear as links on the end of
>> the
>>> text. If the line in sub plot is changed to: >>> >>> $plot =~ s/\s+full summary \| (full|add) synopsis//; >>> >>> then this appears to strip them quite happily.
>> >> Looks like I spoke to soon on this. Using: >> >> my ($film, $year) = ("The Bravados", 1958); >> >> results in: >> >> PLOT: >> Jim Douglas has been relentlessly pursuing the four outlaws who >> murdered his wife, but finds them in jail about to be hanged... more | >> add synopsis >> >> so probably a better regular expression would be: >> >> $plot =~ s/\s+(full summary|more) \| (full|add) synopsis//; >> >> >>
> >
-- Gerph <http://gerph.org/> [ All information, speculation, opinion or data within, or attached to, this email is private and confidential. Such content may not be disclosed to third parties, or a public forum, without explicit permission being granted. ]