-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from bcc-code/feat/import-audio-form-mu1-mu2
Import audo form MU1 and MU2
- Loading branch information
Showing
11 changed files
with
477 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package main | ||
|
||
import ( | ||
ingestworkflows "github.com/bcc-code/bcc-media-flows/workflows/ingest" | ||
"github.com/gin-gonic/gin" | ||
"github.com/gin-gonic/gin/binding" | ||
"github.com/google/uuid" | ||
"go.temporal.io/sdk/client" | ||
"net/http" | ||
) | ||
|
||
func (s *TriggerServer) ingestFixGET(c *gin.Context) { | ||
c.HTML(http.StatusOK, "ingest-fix.gohtml", nil) | ||
} | ||
|
||
type mu1mu2ExtractForm struct { | ||
VX1ID string `form:"vx1" binding:"required"` | ||
VX2ID string `form:"vx2" binding:"required"` | ||
} | ||
|
||
func (s *TriggerServer) mu1mu2ExtractPOST(c *gin.Context) { | ||
var form mu1mu2ExtractForm | ||
err := c.ShouldBindWith(&form, binding.Form) | ||
if err != nil { | ||
renderErrorPage(c, http.StatusInternalServerError, err) | ||
return | ||
} | ||
|
||
queue := getQueue() | ||
workflowOptions := client.StartWorkflowOptions{ | ||
ID: uuid.NewString(), | ||
TaskQueue: queue, | ||
} | ||
|
||
_, err = s.wfClient.ExecuteWorkflow(c, workflowOptions, ingestworkflows.ExtractAudioFromMU1MU2, ingestworkflows.ExtractAudioFromMU1MU2Input{ | ||
MU1ID: form.VX1ID, | ||
MU2ID: form.VX2ID, | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<script src="https://cdn.tailwindcss.com?plugins=forms,typography"></script> | ||
</head> | ||
|
||
<body class=""> | ||
<form method="POST" action="/ingest-fix/ingest-fix/mu1mu2extract" class="flex flex-col min-h-screen gap-2 mx-auto p-14 max-w-screen-lg"> | ||
<div class="max-w-none flex flex-col gap-2"> | ||
<h2 class="text-2xl font-bold">Extract Audio from MU1 and MU2</h2> | ||
</div> | ||
|
||
<div class="flex flex-col gap-2 w-full mt-8 w-20"> | ||
<div class="flex flex-col"> | ||
<label for="filename">MU1 VX-ID:</label> | ||
<input id="filename" class="border" type="text" name="vx1" pattern="VX-[0-9]+" required> | ||
</div> | ||
|
||
<div class="flex flex-col"> | ||
<label for="filename">MU2 VX-ID:</label> | ||
<input id="filename" class="border" type="text" name="vx2" pattern="VX-[0-9]+" required> | ||
</div> | ||
|
||
<input id="submit" | ||
class="cursor-pointer rounded-md bg-[#6A64F1] py-3 px-8 text-center text-base font-semibold text-white outline-none" | ||
type="submit" value="Start"> | ||
</div> | ||
</form> | ||
|
||
<script></script> | ||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.