Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def do_transcode(self, media_format, quality):
transcode, created = self.transcodes.get_or_create(
media_format=media_format,
)
if transcode.processing is False:
transcode.processing = True
transcode.error_messages = ''
transcode.quality = quality
# Lock the transcode model
transcode.save(update_fields=['processing', 'error_message',
'quality'])
TranscodingThread(transcode).start()
else:
pass # TODO Queue?