mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 07:09:16 +02:00
Implemented followers notification on import and autoimport
This commit is contained in:
parent
adcbe8852d
commit
f31874edf5
10 changed files with 253 additions and 5 deletions
|
@ -505,8 +505,17 @@ class ImportBatch(models.Model):
|
|||
return str(self.pk)
|
||||
|
||||
def update_status(self):
|
||||
old_status = self.status
|
||||
self.status = utils.compute_status(self.jobs.all())
|
||||
self.save(update_fields=['status'])
|
||||
if self.status != old_status and self.status == 'finished':
|
||||
from . import tasks
|
||||
tasks.import_batch_notify_followers.delay(import_batch_id=self.pk)
|
||||
|
||||
def get_federation_url(self):
|
||||
return federation_utils.full_url(
|
||||
'/federation/music/import/batch/{}'.format(self.uuid)
|
||||
)
|
||||
|
||||
|
||||
class ImportJob(models.Model):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue