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:
2024-12-26 18:34:33 +02:00
parent fb390bbcbe
commit 2e1d175e98
3 changed files with 44 additions and 47 deletions
+3 -9
View File
@@ -30,7 +30,7 @@ type filesStatMsg struct {
files []string
}
func (m *model) statFiles() tea.Msg {
func (m *Model) statFiles() tea.Msg {
if m.IsDirectory {
entries, _ := os.ReadDir(m.Path)
@@ -70,12 +70,6 @@ func (m *model) statFiles() tea.Msg {
}
}
type encodingStartedMsg struct{}
func startEncoding() tea.Msg {
return encodingStartedMsg{}
}
type encodeVideoMsg struct{}
func encodeVideo() tea.Msg {
@@ -93,7 +87,7 @@ type parsedCfgMsg struct {
dryRun bool
}
func (m *model) parseConfig(dryRun bool) tea.Cmd {
func (m *Model) parseConfig(dryRun bool) tea.Cmd {
m.DryRun = dryRun
return func() tea.Msg {
@@ -120,7 +114,7 @@ type errQuitMsg struct {
msg string
}
func (m *model) cleanUp() tea.Msg {
func (m *Model) cleanUp() tea.Msg {
if len(m.Files) == 0 {
return tea.Quit()
}