update poster

This commit is contained in:
j 2017-05-03 20:02:55 +02:00
parent 0963abac9b
commit 2717d820a1

View file

@ -306,11 +306,15 @@ class Item(models.Model):
return p return p
def update_external(self): def update_external(self):
poster_url = self.prefered_poster_url()
if settings.DATA_SERVICE and not self.public_id.startswith('0x'): if settings.DATA_SERVICE and not self.public_id.startswith('0x'):
response = external_data('getData', {'id': self.public_id}) response = external_data('getData', {'id': self.public_id})
if response['status']['code'] == 200: if response['status']['code'] == 200:
self.external_data = response['data'] self.external_data = response['data']
self.save(sync=True) self.save(sync=True)
if poster_url != self.prefered_poster_url():
self.remove_poster()
self.make_poster()
return True return True
return False return False