if no poster frames are selected, take some
This commit is contained in:
parent
aa5976273e
commit
e585a0ddff
1 changed files with 11 additions and 0 deletions
|
@ -130,6 +130,17 @@ class List(models.Model):
|
||||||
|
|
||||||
def update_icon(self):
|
def update_icon(self):
|
||||||
frames = []
|
frames = []
|
||||||
|
if not self.poster_frames:
|
||||||
|
items = self.get_items(self.user).filter(rendered=True)
|
||||||
|
if items.count():
|
||||||
|
poster_frames = []
|
||||||
|
for i in range(0, items.count(), min(1, int(items.count()/4))):
|
||||||
|
poster_frames.append({
|
||||||
|
'item': items[int(i)].itemId,
|
||||||
|
'position': items[int(i)].poster_frame
|
||||||
|
})
|
||||||
|
self.poster_frames = tuple(poster_frames)
|
||||||
|
self.save()
|
||||||
for i in self.poster_frames:
|
for i in self.poster_frames:
|
||||||
from item.models import Item
|
from item.models import Item
|
||||||
qs = Item.objects.filter(itemId=i['item'])
|
qs = Item.objects.filter(itemId=i['item'])
|
||||||
|
|
Loading…
Reference in a new issue