better unicode representation of imdb object
This commit is contained in:
parent
5482248fee
commit
fc6b81383e
1 changed files with 3 additions and 3 deletions
|
@ -67,7 +67,7 @@ class Imdb(models.Model):
|
|||
invalid = models.BooleanField(default=False)
|
||||
|
||||
def __unicode__(self):
|
||||
return u"%s (%s)" % (self.title, self.imdb)
|
||||
return u"[%s] %s%s" % (self.imdb, self.title, self.year and ' (%s)' % self.year or '')
|
||||
|
||||
keys = ('title', 'director', 'year', 'season', 'episode',
|
||||
'episodeTitle', 'episodeYear', 'episodeDirector')
|
||||
|
@ -120,9 +120,9 @@ def get_new_ids(timeout=-1):
|
|||
ids = re.compile('<loc>http://www.imdb.com/title/tt(\d{7})/combined</loc>').findall(s)
|
||||
added = 0
|
||||
for i in frozenset(ids) - known_ids:
|
||||
m= Imdb(imdb=i)
|
||||
print i
|
||||
m = Imdb(imdb=i)
|
||||
m.update()
|
||||
print m
|
||||
added += 1
|
||||
if added:
|
||||
print url, added
|
||||
|
|
Loading…
Reference in a new issue