forked from rc/aircox
add download link; update player and pages layout
This commit is contained in:
@ -42,6 +42,10 @@ class SoundQuerySet(models.QuerySet):
|
||||
""" Return sounds available as podcasts """
|
||||
return self.filter(is_public=True)
|
||||
|
||||
def downloadable(self):
|
||||
""" Return sounds available as podcasts """
|
||||
return self.filter(is_downloadable=True)
|
||||
|
||||
def archive(self):
|
||||
""" Return sounds that are archives """
|
||||
return self.filter(type=Sound.TYPE_ARCHIVE)
|
||||
@ -131,7 +135,8 @@ class Sound(models.Model):
|
||||
default=False,
|
||||
)
|
||||
is_downloadable = models.BooleanField(
|
||||
_('downloadable'), help_text=_('whether it can be publicly downloaded by visitors'),
|
||||
_('downloadable'),
|
||||
help_text=_('whether it can be publicly downloaded by visitors (sound must be public)'),
|
||||
default=False,
|
||||
)
|
||||
|
||||
@ -153,6 +158,8 @@ class Sound(models.Model):
|
||||
self.program = self.episode.program
|
||||
if check:
|
||||
self.check_on_file()
|
||||
if not self.is_public:
|
||||
self.is_downloadable = False
|
||||
self.__check_name()
|
||||
super().save(*args, **kwargs)
|
||||
|
||||
|
Reference in New Issue
Block a user