mirror of
https://github.com/IllusionMan1212/ffui.git
synced 2026-10-24 02:12:35 +00:00
misc: small clean ups and fixes
fix: dry run command truncation by printing the command after bubbletea quits Remove unnecessary startEncoding tea.Cmd Capitalize model struct to Model
This commit is contained in:
@@ -46,11 +46,29 @@ func main() {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
_, err = p.Run()
|
||||
final, err := p.Run()
|
||||
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
finalModel, _ := final.(Model)
|
||||
|
||||
if finalModel.DryRun {
|
||||
for _, file := range finalModel.Files {
|
||||
parentDir := filepath.Dir(file)
|
||||
fileName := filepath.Base(file)
|
||||
extensionIndex := strings.LastIndex(fileName, ".")
|
||||
newFileName := fileName[:extensionIndex]
|
||||
extension := fileName[extensionIndex:]
|
||||
outFileFullPath := filepath.Join(parentDir, newFileName+fmt.Sprintf("_[%s]_[%s]", finalModel.ParsedConfig.VideoEncoder, finalModel.ParsedConfig.AudioEncoder)+extension)
|
||||
|
||||
cmd := exec.Command("ffmpeg", buildFFmpegCmdArgs(file, outFileFullPath, finalModel.ParsedConfig)...)
|
||||
|
||||
fmt.Println(fmt.Sprintf("%s %s", Checkmark, cmd.String()))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func buildFFmpegCmdArgs(fullFilePath string, outFullFilePath string, cfg ParsedConfig, additionalArgs ...string) []string {
|
||||
|
||||
Reference in New Issue
Block a user