[mythtv-users] mythvideo, imdb and ignored words

George Nassas gnassas at mac.com
Sun Jun 25 17:20:26 UTC 2006


On 25-Jun-06, at 8:10 AM, come se fosse antani wrote:

>> thanks for the answer.
> 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.

Hmm, it works for me. I added print statements like this:

    # Strip off the file extension
    if (rindex($query, '.') != -1) {
       $query = substr($query, 0, rindex($query, '.'));
       print "without extension: ", $query, "\n";
    }
    if (rindex($query, '.') != -1) {
       $query = substr($query, 0, rindex($query, '.'));
       print "without second bit: ", $query, "\n";
    }

and saw this output:

./imdbtest.pl -M "the new world.antani.avi"
without extension: the new world.antani
without second bit: the new world
0402399:The New World (2005)
0008133:The Immigrant (1917)
0114009:Nouveau monde, Le (1995)
0156834:Naya Sansar (1959)
0067478:Naya Zamana (1971)
0168512:Birth Control (1917)

and

./imdbtest.pl -M "the new world.avi"
without extension: the new world
0402399:The New World (2005)
0008133:The Immigrant (1917)
0114009:Nouveau monde, Le (1995)
0156834:Naya Sansar (1959)
0067478:Naya Zamana (1971)
0168512:Birth Control (1917)

I'm testing with perl 5.8.6 on my Mac because I'm away from my linux  
machine but rindex and substr haven't changed in ages if ever so  
version and platform are unlikely to be issues.

Could it be you have multiple copies if imdb.pl and myth is using an  
unmodified copy?

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

You could replace the if(s) with this:

    $query =~ s/([.].*){1,2}$//;

but some people find that hard to understand at a glance. In my old  
age I've been moving away from gratuitous excess cleverness.

- George



More information about the mythtv-users mailing list