[mythtv-users] mythvideo, imdb and ignored words

come se fosse antani antani at gmail.com
Sun Jun 25 12:10:55 UTC 2006


On 6/25/06, come se fosse antani <antani at gmail.com> wrote:
> On 6/25/06, George Nassas <gnassas at mac.com> wrote:
> > On 25-Jun-06, at 6:39 AM, come se fosse antani wrote:
> >
> > > Hola.
> > > I've some issues with the imdb.pl grabber for mythtv.
> > >
> > > I would to know if it's possibile to exclude some words/chars of the
> > > video filename from the search query of imdb.pl.
> > >
> > > For me is very useful in order to avoid searching for:
> > > - 'dvdrip' or 'cdN'
> > > - italian translation of the movie's title
> > >
> > > Normally I rename my movie files in such way:
> > >
> > > The_Untouchables.Gli_Intoccabili.avi
> > >
> > > I would like to tell imdb.pl to ignore anything after a dot (.).
> > >
> > > any suggestion?
> >
> > Look in the script for "sub getMovieList" and add some code after the
> > "query =" assignment. Duplicating the first "if rindex" block will
> > remove the Italian translation if it's present. To get rid of
> > embedded text like dvdrip or cdNN you could add lines like:
> >
> >         $query =~ s/dvdrip//;
> >         $query =~ s/cd[[:digit:]]+//;
> >
> > - George
> >
>
> thanks for the answer.
> AFAIUnderstand, I can follow your first suggestion (duplicating the
> 1st "if rindex") in order to avoid that imdb.pl search imdb for
> anything that appears in the filename after a dot. right?
> this "anything" can be even the italian translation or the dvdrip cdNN
> info, right?
>

Nope. Sorry: I could try it before posting.
I tried duplicating the 1st rindex [1] but it don't works; I named two
files "the new world.avi" and "the new world.antani.avi". For the
first file imdb.pl works but not for the second.

Can I use only one rule to avoid anything after a dot?

#####
[1] Here the modified part of imdb,pl
# dump Movie list:  1 entry per line, each line as 'movieid:Movie Title'
sub getMovieList {
   my ($filename, $options)=@_; # grab parameters

   # If we wanted to inspect the file for any reason we can do that now

   #
   # Convert filename into a query string
   # (use same rules that Metadata::guesTitle does)
   my $query = $filename;
   $query = uri_unescape($query);  # in case it was escaped
   # Strip off the file extension
   if (rindex($query, '.') != -1) {
      $query = substr($query, 0, rindex($query, '.'));
   }
   # Trying to strip off anything in the filename after a dot
   if (rindex($query, '.') != -1) {
      $query = substr($query, 0, rindex($query, '.'));
   }


More information about the mythtv-users mailing list