Default to valid JSON

This prevents useless logged errors when there is no metadata available yet.
This commit is contained in:
tcely 2025-01-27 02:57:47 -05:00 committed by GitHub
parent 3130ff2816
commit 09ecbf210e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1153,7 +1153,7 @@ class Media(models.Model):
from common.utils import json_serial
old_mdl = len(self.metadata or "")
data = json.loads(self.metadata or "")
data = json.loads(self.metadata or "{}")
compact_json = json.dumps(data, separators=(',', ':'), default=json_serial)
filtered_data = filter_response(data, True)