mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-04 06:29:18 +02:00
Fixed #33: sort by track position in album in API vy default, also reuse that information on frontend side
This commit is contained in:
parent
f1c05d4f42
commit
0786c58d3d
5 changed files with 29 additions and 6 deletions
|
@ -27,6 +27,7 @@ class APIModelMixin(models.Model):
|
|||
api_includes = []
|
||||
creation_date = models.DateTimeField(default=timezone.now)
|
||||
import_hooks = []
|
||||
|
||||
class Meta:
|
||||
abstract = True
|
||||
ordering = ['-creation_date']
|
||||
|
@ -291,6 +292,9 @@ class Track(APIModelMixin):
|
|||
]
|
||||
tags = TaggableManager()
|
||||
|
||||
class Meta:
|
||||
ordering = ['album', 'position']
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
@ -386,6 +390,8 @@ class ImportJob(models.Model):
|
|||
)
|
||||
status = models.CharField(choices=STATUS_CHOICES, default='pending', max_length=30)
|
||||
|
||||
class Meta:
|
||||
ordering = ('id', )
|
||||
@celery.app.task(name='ImportJob.run', filter=celery.task_method)
|
||||
def run(self, replace=False):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue