Refactor package "convertor" "Main" method.

Moved the button for selecting a video file into a separate function.
This commit is contained in:
2024-01-15 20:28:02 +06:00
parent 97dd0f4b32
commit dddbfa65bc
3 changed files with 85 additions and 59 deletions

View File

@@ -38,7 +38,7 @@ func (h ConvertorHandler) GetConvertor() {
h.convertorView.Main(h.runConvert, h.getSockPath)
}
func (h ConvertorHandler) getSockPath(file convertor.File, progressbar *widget.ProgressBar) (string, error) {
func (h ConvertorHandler) getSockPath(file *convertor.File, progressbar *widget.ProgressBar) (string, error) {
totalDuration, err := h.getTotalDuration(file)
if err != nil {
@@ -101,6 +101,6 @@ func (h ConvertorHandler) runConvert(setting convertor.HandleConvertSetting) err
)
}
func (h ConvertorHandler) getTotalDuration(file convertor.File) (float64, error) {
func (h ConvertorHandler) getTotalDuration(file *convertor.File) (float64, error) {
return h.convertorService.GetTotalDuration(file)
}