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

Report information
The Basics
Id:
53577
Status:
resolved
Priority:
Low/Low
Queue:

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

BugTracker
Severity:
Normal
Broken in:
0.42
Fixed in:
(no value)



Subject: Failure to find a film cover for 'Wall-E', and fix
Fun one for cover fetching which wasn't obvious until I noticed that Wall-E didn't have a cover returned... In sub cover it looks for an img with the same alt text as the film title. Which is cute. But the title has had special characters replaced - in particular the middot is replaced, which means that when compared, it doesn't match. 'WALL&#xBF;E' is not the same as 'WALL*E'. My proposed fix is relatively simple - we replace the check with one that does the same special symbol replacement (and a small amount of extra debug to help diagnose the problem): (apologies for formatting below) my $alt = $img_tag->[1]{alt} || ''; # Apply the same decoding as the title (otherwise 'Wall<mid-dot>E' doesn't work) $alt = $self->_decode_special_symbols($alt); $self->_show_message("Cover: Found '$alt'", 'DEBUG'); last if $alt =~ /^poster not submitted/i; if($alt =~ /^$title$/i) { $cover = $img_tag->[1]{src}; last; } additionally, we could save a regular expression match by using $title = lc ... and if (lc $alt eq $title), but that's not too important really. I've not checked back beyond 0.42, which I'm using, but I have checked 0.43 and the code appears unchanged in there so I guess it's still like that. Hope that helps, and that you had a good Christmas and New Year :-)
Subject: Re: [rt.cpan.org #53577] Failure to find a film cover for 'Wall-E', and fix
Date: Mon, 11 Jan 2010 09:47:25 +0200
To: bug-IMDB-Film@rt.cpan.org
From: Michael Stepanov <stepanov.michael@gmail.com>
Hi Justin,

Thanks for your bug-report and patch. I'll check it and include in the next release.

On Sun, Jan 10, 2010 at 11:55 PM, Justin Fletcher via RT <bug-IMDB-Film@rt.cpan.org> wrote:
Show quoted text
Sun Jan 10 16:55:01 2010: Request 53577 was acted upon.
Transaction: Ticket created by gerph
      Queue: IMDB-Film
    Subject: Failure to find a film cover for 'Wall-E', and fix
  Broken in: 0.42
   Severity: Normal
      Owner: Nobody
 Requestors: gerph@gerph.org
     Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=53577 >


Fun one for cover fetching which wasn't obvious until I noticed that
Wall-E didn't have a cover returned...

In sub cover it looks for an img with the same alt text as the film
title. Which is cute. But the title has had special characters replaced
- in particular the middot is replaced, which means that when compared,
it doesn't match. 'WALL&#xBF;E' is not the same as 'WALL*E'.

My proposed fix is relatively simple - we replace the check with one
that does the same special symbol replacement (and a small amount of
extra debug to help diagnose the problem):

(apologies for formatting below)
 my $alt = $img_tag->[1]{alt} || '';

 # Apply the same decoding as the title (otherwise 'Wall<mid-dot>E'
doesn't work)
 $alt = $self->_decode_special_symbols($alt);

 $self->_show_message("Cover: Found '$alt'", 'DEBUG');
 last if $alt =~ /^poster not submitted/i;

 if($alt =~ /^$title$/i) {
   $cover = $img_tag->[1]{src};
   last;
 }

additionally, we could save a regular expression match by using $title
= lc ... and if (lc $alt eq $title), but that's not too important
really.

I've not checked back beyond 0.42, which I'm using, but I have checked
0.43 and the code appears unchanged in there so I guess it's still like
that.

Hope that helps, and that you had a good Christmas and New Year :-)



This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.