added percentage
Browse files- App/Transcription/TranscriptionRoutes.py +6 -2
- App/app.py +1 -0
App/Transcription/TranscriptionRoutes.py
CHANGED
@@ -152,9 +152,10 @@ async def get_status(task_id):
|
|
152 |
result = BaseTranscription(**entry.__dict__)
|
153 |
|
154 |
if result.status == "SUCCESS":
|
|
|
155 |
return result
|
156 |
task_result = AsyncResult(task_id)
|
157 |
-
print(task_result.result)
|
158 |
if task_result.result == None:
|
159 |
return {
|
160 |
"task_id": task_id,
|
@@ -164,13 +165,16 @@ async def get_status(task_id):
|
|
164 |
|
165 |
if task_result.status == "SUCCESS":
|
166 |
trans = TranscriptionMetadata(**task_result.result)
|
|
|
167 |
await entry.update(**trans.dict())
|
168 |
else:
|
169 |
try:
|
170 |
_trans = TranscriptionMetadata(**task_result.result)
|
|
|
171 |
except:
|
172 |
return {"payload": None, "message": "Nothing found", "code": 200}
|
173 |
await entry.update(**_trans.dict())
|
174 |
|
175 |
result = BaseTranscription(**entry.__dict__)
|
176 |
-
|
|
|
|
152 |
result = BaseTranscription(**entry.__dict__)
|
153 |
|
154 |
if result.status == "SUCCESS":
|
155 |
+
result.percentage='100'
|
156 |
return result
|
157 |
task_result = AsyncResult(task_id)
|
158 |
+
# print(task_result.result)
|
159 |
if task_result.result == None:
|
160 |
return {
|
161 |
"task_id": task_id,
|
|
|
165 |
|
166 |
if task_result.status == "SUCCESS":
|
167 |
trans = TranscriptionMetadata(**task_result.result)
|
168 |
+
percentage='100'
|
169 |
await entry.update(**trans.dict())
|
170 |
else:
|
171 |
try:
|
172 |
_trans = TranscriptionMetadata(**task_result.result)
|
173 |
+
percentage=trans.percentage
|
174 |
except:
|
175 |
return {"payload": None, "message": "Nothing found", "code": 200}
|
176 |
await entry.update(**_trans.dict())
|
177 |
|
178 |
result = BaseTranscription(**entry.__dict__)
|
179 |
+
result.percentage=percentage
|
180 |
+
return result
|
App/app.py
CHANGED
@@ -49,6 +49,7 @@ async def startup_event():
|
|
49 |
# await bot.start(bot_token="6183919505:AAEhHFt4mI18bQeAf2Lj7AePXFRPVLrOFM8")
|
50 |
# await upload_bot.start()
|
51 |
# await models.create_all()
|
|
|
52 |
|
53 |
# await create_async_model(models)
|
54 |
if not database.is_connected:
|
|
|
49 |
# await bot.start(bot_token="6183919505:AAEhHFt4mI18bQeAf2Lj7AePXFRPVLrOFM8")
|
50 |
# await upload_bot.start()
|
51 |
# await models.create_all()
|
52 |
+
# models.metadata.create_all()
|
53 |
|
54 |
# await create_async_model(models)
|
55 |
if not database.is_connected:
|