On Nov 26, Jonas Geiregat <jo...@geiregat.org> wrote:

> When trying out the method get_imdbMovieId() it doesn't return an
> object. It does return the same string I entered as param.
> 
> >>> ai.get_imdbMovieID("Snatch")
> 'Snatch'
> 
> Is this method not implemented yet ?

It is, but it serves another purpose. :-)
See documentation about it in README.package, README.devel and
in the code itself.

Basically, it takes a movieID specific to the used data access
system (i.e. "http", "httpThin", "mobile" or "sql") and convert
it to the unique imdbID used on the imdb.com web site.
For "http"/"httpThin" and "mobile", it does nothing since they
use the same ID (i.e., the movieID _is_ the imdbID).
But "sql" internally uses IDs that are valid only locally (to your
installation); this means that a query to the imdb.com site must
be issued, to convert it to the "real" imdbID (beware that it can
return None).

Generally speaking, it's better to use the get_imdbID method, which
takes a Movie/Person/Character/Company instance, and not a
movieID/personID/characterID/companyID.

E.g.:
  from imdb import IMDb
  ia = IMDb('sq', uri='mysql://USER:p...@localhost/imdb') # my local DB.
  tu = ia.search_movie(u'The Untouchables (1987)')[0] # First item.
  print tu.movieID # will print 558195, valid only for my database.
  print ia.get_imdbID(tu) # will print '0094226', that is the ID used
                          # by imdb.com
  # The same thing, with the less flexible/smart get_imdbMovieId:
  print ia.get_imdbMovieId(tu.movieID)


HTH,
-- 
Davide Alberani <davide.alber...@gmail.com> [GPG KeyID: 0x465BFD47]
http://erlug.linux.it/~da/

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Imdbpy-help mailing list
Imdbpy-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/imdbpy-help

Reply via email to