Limit the metadata_title string to fit in the title column

This commit is contained in:
tcely 2025-02-10 08:48:16 -05:00 committed by GitHub
parent b8f8d9d7fa
commit 488294475a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -935,7 +935,7 @@ class Media(models.Model):
def save(self, force_insert=False, force_update=False, using=None, update_fields=None):
# Trigger an update of derived fields from metadata
if self.metadata:
self.title = self.metadata_title
self.title = self.metadata_title[:200]
self.duration = self.metadata_duration
if update_fields is not None and "metadata" in update_fields:
# If only some fields are being updated, make sure we update title and duration if metadata changes