forked from 0x2620/pandora
update poster
This commit is contained in:
parent
0963abac9b
commit
2717d820a1
1 changed files with 4 additions and 0 deletions
|
@ -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
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue