From 073aaa1b3276b44a0cb7e2ee3fcff9b1c52cb044 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Mon, 8 Oct 2012 13:44:02 +0200 Subject: [PATCH] make directors unique but keep order, fixes #1076 --- ox/web/imdb.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ox/web/imdb.py b/ox/web/imdb.py index 2ed8e39..7ecb4ae 100644 --- a/ox/web/imdb.py +++ b/ox/web/imdb.py @@ -457,6 +457,12 @@ class Imdb(SiteParser): self['episodeDirector'] = self['director'] self['director'] = self['creator'] + #make lists unique but keep order + for key in ('director',): + if key in self: + self[key] = [x for i,x in enumerate(self[key]) + if x not in self[key][i+1:]] + for key in ('actor', 'writer', 'producer', 'editor'): if key in self: if isinstance(self[key][0], list):