From 43e8efc47093957aff9b97e0a0ae2355c0631a0d Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 2 Jul 2012 15:06:08 +0200 Subject: [PATCH] person keys should be unique fixes #900 --- ox/web/imdb.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 5ab5833..54afe74 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -400,6 +400,11 @@ class Imdb(SiteParser): self['episodeDirector'] = self['director'] self['director'] = self['creator'] + for key in ('actor', 'writer', 'producer', 'editor'): + if key in self: + self[key] = sorted(list(set(self[key])), + lambda a, b: self[key].index(a) - self[key].index(b)) + if 'budget' in self and 'gross' in self: self['profit'] = self['gross'] - self['budget']