one sound, one parent: Diffusion.sounds -> Sound.diffusion; player: playerStore, save pos when time update, single mode

This commit is contained in:
bkfox
2016-06-20 22:44:25 +02:00
parent ceecbcfa54
commit 2564ba298a
4 changed files with 151 additions and 48 deletions

View File

@ -25,7 +25,7 @@ class StreamInline(admin.TabularInline):
extra = 1
class SoundDiffInline(admin.TabularInline):
model = Diffusion.sounds.through
model = Sound
# from suit.admin import SortableTabularInline, SortableModelAdmin
#class TrackInline(SortableTabularInline):

View File

@ -104,15 +104,17 @@ class Sound(Nameable):
"""
A Sound is the representation of a sound file that can be either an excerpt
or a complete archive of the related diffusion.
The podcasting and public access permissions of a Sound are managed through
the related program info.
"""
class Type(IntEnum):
other = 0x00,
archive = 0x01,
excerpt = 0x02,
diffusion = models.ForeignKey(
'Diffusion',
verbose_name = _('diffusion'),
blank = True, null = True,
)
type = models.SmallIntegerField(
verbose_name = _('type'),
choices = [ (int(y), _(x)) for x,y in Type.__members__.items() ],
@ -550,11 +552,6 @@ class Diffusion(models.Model):
'Program',
verbose_name = _('program'),
)
sounds = models.ManyToManyField(
Sound,
blank = True,
verbose_name = _('sounds'),
)
# specific
type = models.SmallIntegerField(
verbose_name = _('type'),