mirror of
https://github.com/IllusionMan1212/ffui.git
synced 2026-10-24 02:12:35 +00:00
clearer(?) config name for when output file name conflicts with another
This commit is contained in:
@@ -311,7 +311,7 @@ func parseConfig(cfg []Config) ParsedConfig {
|
||||
|
||||
return ParsedConfig{
|
||||
DeleteOldVideo: find(cfg, "Delete old video(s)?").FocusedOption != 0,
|
||||
SkipEncodedVid: find(cfg, "What should we do about encoded videos?").FocusedOption == 0,
|
||||
IgnoreConflictingName: find(cfg, "On name conflict?").FocusedOption == 0,
|
||||
VideoEncoder: vEncoder.Opts[vEncoder.FocusedOption],
|
||||
AudioEncoder: aEncoder.Opts[aEncoder.FocusedOption],
|
||||
Preset: preset.Opts[preset.FocusedOption],
|
||||
|
||||
@@ -99,7 +99,7 @@ func (m *Model) parseConfig(dryRun bool) tea.Cmd {
|
||||
return parsedCfgMsg{
|
||||
parsedConfig: ParsedConfig{
|
||||
DeleteOldVideo: find(m.Config, "Delete old video(s)?").FocusedOption != 0,
|
||||
SkipEncodedVid: find(m.Config, "What should we do about encoded videos?").FocusedOption == 0,
|
||||
IgnoreConflictingName: find(m.Config, "On name conflict?").FocusedOption == 0,
|
||||
VideoEncoder: vEncoder.Opts[vEncoder.FocusedOption],
|
||||
AudioEncoder: aEncoder.Opts[aEncoder.FocusedOption],
|
||||
Preset: preset.Opts[preset.FocusedOption],
|
||||
|
||||
@@ -18,7 +18,7 @@ var SupportedAudioEncoders = []string{
|
||||
|
||||
var Configs = []Config{
|
||||
{Name: "Delete old video(s)?", Opts: []string{"No", "Yes"}, FocusedOption: 1},
|
||||
{Name: "What should we do about encoded videos?", Opts: []string{"Skip", "Delete and encode again"}},
|
||||
{Name: "On name conflict?", Opts: []string{"Ignore", "Overwrite"}},
|
||||
{Name: "Video Encoder", Opts: []string{"copy"}},
|
||||
{Name: "Audio Encoder", Opts: []string{"None", "copy"}, FocusedOption: 1},
|
||||
{Name: "Preset", Opts: []string{"ultrafast", "superfast", "veryfast", "faster", "fast", "medium", "slow", "slower", "veryslow"}, FocusedOption: 4},
|
||||
@@ -33,7 +33,7 @@ type Config struct {
|
||||
|
||||
type ParsedConfig struct {
|
||||
DeleteOldVideo bool
|
||||
SkipEncodedVid bool
|
||||
IgnoreConflictingName bool
|
||||
VideoEncoder string
|
||||
AudioEncoder string
|
||||
Preset string
|
||||
|
||||
@@ -135,7 +135,7 @@ func encode(fullFilePath string, fileName string, teaP *tea.Program, cfg ParsedC
|
||||
newFileFullPath := filepath.Join(parentDir, newFileName+fmt.Sprintf("_[%s]_[%s]", cfg.VideoEncoder, cfg.AudioEncoder)+extension)
|
||||
|
||||
if _, err := os.Stat(newFileFullPath); err == nil {
|
||||
if cfg.SkipEncodedVid {
|
||||
if cfg.IgnoreConflictingName {
|
||||
log.Printf("Skipping \"%s\" because it already exists with the exact same encodings (crf and preset might be different though)", newFileFullPath)
|
||||
teaP.Send(finishedEncodingVideo{})
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user