Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Sep 9, 2024
1 parent b6db941 commit e90aba0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
46 changes: 27 additions & 19 deletions plugin/AI/receiveAsync.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,15 @@
_error_log('AI: ' . basename(__FILE__) . ' line=' . __LINE__);
if (!empty($_REQUEST['response'])) {
$jsonDecoded = Ai_transcribe_responses::saveVTT(
$_REQUEST['response']['vtt'],
$_REQUEST['response']['language'],
$_REQUEST['response']['duration'],
$_REQUEST['response']['text'],
$_REQUEST['response']['total_price'],
$_REQUEST['response']['size_in_bytes'],
$_REQUEST['response']['mp3'],
$jsonDecoded);
$_REQUEST['response']['vtt'],
$_REQUEST['response']['language'],
$_REQUEST['response']['duration'],
$_REQUEST['response']['text'],
$_REQUEST['response']['total_price'],
$_REQUEST['response']['size_in_bytes'],
$_REQUEST['response']['mp3'],
$jsonDecoded
);
}
break;
case AI::$typeShorts:
Expand Down Expand Up @@ -138,20 +139,27 @@
}
}

$jsonDecoded->addAudioTrack = HLSAudioManager::addAudioTrack($token->videos_id, $mp3URL, $language);
$jsonDecoded->addAudioTrack = HLSAudioManager::addAudioTrack($token->videos_id, $mp3URL, $language);
$jsonDecoded->error = empty($jsonDecoded->addAudioTrack);
$vtt = file_get_contents($vttURL);
$jsonDecoded = Ai_transcribe_responses::saveVTT(
$vtt ,
$language,
0,
$vtt,
0,
strlen($vtt),
$mp3URL,
$jsonDecoded);

_error_log('End line=' . __LINE__.' '.json_encode($jsonDecoded->addAudioTrack));
$vtt,
$language,
0,
$vtt,
0,
strlen($vtt),
$mp3URL,
$jsonDecoded
);

$o = new Ai_responses_json(0);
$o->setResponse($jsonDecoded);
$o->setAi_type(AI::$typeDubbing);
$o->setAi_responses_id($token->ai_responses_id);
$jsonDecoded->Ai_transcribe_responses = $o->save();

_error_log('End line=' . __LINE__ . ' ' . json_encode($jsonDecoded->addAudioTrack));
//$jsonDecoded->lines[] = __LINE__;
}
break;
Expand Down
2 changes: 1 addition & 1 deletion plugin/AI/tabs/usage.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// Convert file size to human-readable format
$formattedSize = humanFileSize($fileSize);

echo "<a href='{$url}' class='list-group-item'>";
echo "<a href='{$url}' class='list-group-item' target='_blank'>";
echo "<h4 class='list-group-item-heading'>File: " . basename($path) . "</h4>";
echo "<p class='list-group-item-text'>Duration: $duration</p>";
echo "<p class='list-group-item-text'>File Size: $formattedSize</p>";
Expand Down

0 comments on commit e90aba0

Please sign in to comment.