support for homebrew ffmpeg on macos (#649)
* support for homebrew ffmpeg on macos * Add build instructions * Revise README * Detect homebrew and install ffmpeg with homebrew --------- Co-authored-by: afkarxyz <mzamzamafkarhadiq@gmail.com>
This commit is contained in:
@@ -1041,10 +1041,6 @@ func (a *App) IsFFprobeInstalled() (bool, error) {
|
||||
return backend.IsFFprobeInstalled()
|
||||
}
|
||||
|
||||
func (a *App) GetFFmpegPath() (string, error) {
|
||||
return backend.GetFFmpegPath()
|
||||
}
|
||||
|
||||
type DownloadFFmpegRequest struct{}
|
||||
|
||||
type DownloadFFmpegResponse struct {
|
||||
@@ -1073,6 +1069,41 @@ func (a *App) DownloadFFmpeg() DownloadFFmpegResponse {
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) GetBrewPath() string {
|
||||
return backend.GetBrewPath()
|
||||
}
|
||||
|
||||
func (a *App) IsBrewFFmpegInstalled() (bool, error) {
|
||||
return backend.IsBrewFFmpegInstalled()
|
||||
}
|
||||
|
||||
type InstallFFmpegWithBrewResponse struct {
|
||||
Success bool `json:"success"`
|
||||
Message string `json:"message"`
|
||||
Error string `json:"error,omitempty"`
|
||||
}
|
||||
|
||||
func (a *App) InstallFFmpegWithBrew() InstallFFmpegWithBrewResponse {
|
||||
runtime.EventsEmit(a.ctx, "ffmpeg:status", "Installing FFmpeg via Homebrew...")
|
||||
err := backend.InstallFFmpegWithBrew(func(progress int, status string) {
|
||||
runtime.EventsEmit(a.ctx, "ffmpeg:progress", progress)
|
||||
runtime.EventsEmit(a.ctx, "ffmpeg:status", status)
|
||||
})
|
||||
if err != nil {
|
||||
runtime.EventsEmit(a.ctx, "ffmpeg:status", "failed")
|
||||
return InstallFFmpegWithBrewResponse{
|
||||
Success: false,
|
||||
Error: err.Error(),
|
||||
}
|
||||
}
|
||||
|
||||
runtime.EventsEmit(a.ctx, "ffmpeg:status", "completed")
|
||||
return InstallFFmpegWithBrewResponse{
|
||||
Success: true,
|
||||
Message: "FFmpeg installed successfully via Homebrew",
|
||||
}
|
||||
}
|
||||
|
||||
type ConvertAudioRequest struct {
|
||||
InputFiles []string `json:"input_files"`
|
||||
OutputFormat string `json:"output_format"`
|
||||
|
||||
Reference in New Issue
Block a user