-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathreset_subtitle_from_blocked_to_quality_control.py
More file actions
executable file
·42 lines (34 loc) · 1.4 KB
/
reset_subtitle_from_blocked_to_quality_control.py
File metadata and controls
executable file
·42 lines (34 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python3
# -*- coding: utf-8 -*-
#==============================================================================
# This script resets a talk from blocked to quality control in progress
#==============================================================================
import os
import sys
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "subtitleStatus.settings")
import django
django.setup()
from django.core.management.base import BaseCommand, CommandError
from django.db import transaction
from django.core.exceptions import ObjectDoesNotExist
from www.models import Subtitle, Talk
if len(sys.argv) != 2:
sys.exit("Too many or less arguments, one is needed!")
subtitle_id = sys.argv[1]
try:
subt = Subtitle.objects.get(id = subtitle_id)
# Nur wenn der Untertitel orignal ist weiter machen und auf quality control setzen
if subt.is_original_lang:
my_talk = Talk.objects.get(id = subt.talk_id)
subt.time_processed_transcribing = my_talk.video_duration
subt.time_processed_syncing = my_talk.video_duration
subt.notify_subtitle_needs_timing = False
subt.blocked = False
subt.state_id = 7 # Quality control done until
subt.notify_subtitle_ready_for_quality_control = True
subt.save()
# Let the related statistics be calculated
subt.talk.reset_related_statistics_data()
print("Done")
except:
print("Fehler!")