forked from rc/aircox
program is not provided
This commit is contained in:
parent
2dd2b766a6
commit
ec59092d34
|
@ -82,12 +82,13 @@ class SoundFile:
|
||||||
return sound
|
return sound
|
||||||
|
|
||||||
# FIXME: sound.program as not null
|
# FIXME: sound.program as not null
|
||||||
kwargs['program'] = program or Program.get_from_path(self.path)
|
if not program:
|
||||||
|
program = Program.get_from_path(self.path)
|
||||||
|
kwargs['program_id'] = program.pk
|
||||||
|
|
||||||
sound, created = Sound.objects.get_or_create(file=self.sound_path, defaults=kwargs) \
|
sound, created = Sound.objects.get_or_create(file=self.sound_path, defaults=kwargs) \
|
||||||
if not sound else (sound, False)
|
if not sound else (sound, False)
|
||||||
self.sound = sound
|
self.sound = sound
|
||||||
|
|
||||||
sound.program = program
|
sound.program = program
|
||||||
if created or sound.check_on_file():
|
if created or sound.check_on_file():
|
||||||
logger.info('sound is new or have been modified -> %s', self.sound_path)
|
logger.info('sound is new or have been modified -> %s', self.sound_path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user