Explorar el Código

[webpages] Handle title truncation better

Colin Powell hace 2 meses
padre
commit
444562235f
Se han modificado 1 ficheros con 1 adiciones y 2 borrados
  1. 1 2
      vrobbler/apps/webpages/models.py

+ 1 - 2
vrobbler/apps/webpages/models.py

@@ -150,8 +150,7 @@ class WebPage(ScrobblableMixin):
 
         if not self.title and self.extract:
             first_line = self.extract.split("\n")[0]
-            if len(first_line) < 254:
-                self.title = first_line
+            self.title = first_line[:254]
 
         if save:
             self.save(update_fields=["title"])