Code cleanup.

This commit is contained in:
Josh Washburne 2018-03-27 15:58:26 -04:00
parent 5a48b68b2f
commit f9d24de34c

View file

@ -19,6 +19,9 @@ class SongManager(models.Manager):
def get_queryset(self):
return SongQuerySet(self.model, using=self._db)
def available(self):
return self.get_queryset().songs().enabled().published()
def playlist_length(self):
"""
Total length of available songs in the playlist (in seconds).
@ -39,9 +42,6 @@ class SongManager(models.Manager):
"""
return timezone.now() - timedelta(seconds=float(self.wait_total()))
def available(self):
return self.get_queryset().songs().enabled().published()
def playable(self):
return self.available().filter(
models.Q(last_played__lt=self.datetime_from_wait()) |