From 1d40ceca8f408ff7381e4b4bf2d05fee4ef7d6e4 Mon Sep 17 00:00:00 2001 From: j Date: Sun, 7 Oct 2018 14:41:25 +0200 Subject: [PATCH] remove unused external keys --- pandora/item/models.py | 5 +++++ pandora/settings.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/pandora/item/models.py b/pandora/item/models.py index 3750d3ac..6f7e45b5 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -307,6 +307,11 @@ class Item(models.Model): response = external_data('getData', {'id': self.public_id}) if response['status']['code'] == 200: self.external_data = response['data'] + keys = [ + k['id'] for k in settings.CONFIG['itemKeys'] + ] + settings.ADDITIONAL_IMDB_KEYS + for key in set(self.external_data) - set(keys): + del self.external_data[key] self.save(sync=True) if poster_url != self.prefered_poster_url(): self.remove_poster() diff --git a/pandora/settings.py b/pandora/settings.py index 22229d7d..a8e59fed 100644 --- a/pandora/settings.py +++ b/pandora/settings.py @@ -217,6 +217,11 @@ POSTER_PRECEDENCE = () POSTER_ONLY_PORTRAIT = () USE_IMDB = False +ADDITIONAL_IMDB_KEYS = [ + 'cast', + 'links', 'reviews', 'posters', + 'alternativeTitles', 'originalTitle', +] #If you set VIDEO_PREFIX make sure cookies work accros subsomains #by setting SESSION_COOKIE_DOMAIN to ".domain.tld"