Limit the metadata_title string to fit in the title column

This commit is contained in:
tcely authored and GitHub committed 2025-02-10 08:48:16 -05:00
1 parent b8f8d9d7fa
commit 488294475a
1 file changed
+1 -1
+1 -1
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