update poster inline

This commit is contained in:
j 2021-10-08 17:26:24 +01:00
parent ed31259fdd
commit bc123a885e
2 changed files with 7 additions and 4 deletions

View file

@ -240,7 +240,7 @@ class Item(models.Model):
return True return True
return False return False
def edit(self, data): def edit(self, data, is_task=False):
data = data.copy() data = data.copy()
# FIXME: how to map the keys to the right place to write them to? # FIXME: how to map the keys to the right place to write them to?
if 'id' in data: if 'id' in data:
@ -296,7 +296,10 @@ class Item(models.Model):
self.data[key] = ox.escape_html(data[key]) self.data[key] = ox.escape_html(data[key])
p = self.save() p = self.save()
if not settings.USE_IMDB and list(filter(lambda k: k in self.poster_keys, data)): if not settings.USE_IMDB and list(filter(lambda k: k in self.poster_keys, data)):
p = tasks.update_poster.delay(self.public_id) if is_task:
tasks.update_poster(self.public_id)
else:
p = tasks.update_poster.delay(self.public_id)
return p return p
def update_external(self): def update_external(self):

View file

@ -558,8 +558,8 @@ def edit_item(user, item, data, is_task=False):
user_groups = set([g.name for g in user.groups.all()]) user_groups = set([g.name for g in user.groups.all()])
other_groups = list(groups - user_groups) other_groups = list(groups - user_groups)
data['groups'] = [g for g in data['groups'] if g in user_groups] + other_groups data['groups'] = [g for g in data['groups'] if g in user_groups] + other_groups
r = item.edit(data) r = item.edit(data, is_task=is_tras)
if r and not is_task: if r:
r.wait() r.wait()
if update_clips: if update_clips:
tasks.update_clips.delay(item.public_id) tasks.update_clips.delay(item.public_id)