diff --git a/pandora/config.0xdb.jsonc b/pandora/config.0xdb.jsonc index e76d3ce1..c8e8bea8 100644 --- a/pandora/config.0xdb.jsonc +++ b/pandora/config.0xdb.jsonc @@ -359,6 +359,7 @@ "title": "Mainstream Score", "type": "float", "columnWidth": 60, + "default" 0, "format": {"type": "ColorPercent", "args": [1, true]}, "sort": true }, @@ -367,6 +368,7 @@ "title": "Arthouse Score", "type": "float", "columnWidth": 60, + "default" 0, "format": {"type": "ColorPercent", "args": [1, true]}, "sort": true }, diff --git a/pandora/item/models.py b/pandora/item/models.py index c23e810d..8e2a254d 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -383,6 +383,17 @@ class Item(models.Model): if key in self.data: del self.data[key] + # update defaults + if settings.USE_IMDB: + defaults = filter(lambda k: 'default' in k, settings.CONFIG['itemKeys']) + for k in defaults: + if len(self.itemId) == 7: + if k['id'] in self.data and self.data[k['id']] == k['default']: + del self.data[k['id']] + else: + if k['id'] not in self.data: + self.data[k['id']] = k['default'] + if self.poster and os.path.exists(self.poster.path): self.poster_height = self.poster.height self.poster_width = self.poster.width