only update if poster is valid

This commit is contained in:
j 2025-01-24 14:56:11 +05:30
parent 85b88c4dd6
commit c2df43220b

View file

@ -1375,7 +1375,7 @@ class Item(models.Model):
self.poster_height = self.poster.height
self.poster_width = self.poster.width
self.clear_poster_cache(self.poster.path)
if self.cache.get('posterRatio') != self.poster_width / self.poster_height:
if self.poster_width and self.cache.get('posterRatio') != self.poster_width / self.poster_height:
self.update_cache(poster_width=self.poster_width,
poster_height=self.poster_height)