diff --git a/bugs.md b/bugs.md new file mode 100644 index 0000000..b70f5e8 --- /dev/null +++ b/bugs.md @@ -0,0 +1 @@ +- [ ] When `selectFormats` return 0 entries. The entire program crashes. diff --git a/pkg/argparse/argparse.go b/pkg/argparse/argparse.go index eae932e..e9637bc 100644 --- a/pkg/argparse/argparse.go +++ b/pkg/argparse/argparse.go @@ -17,8 +17,9 @@ type Opts struct { NoSpinner bool // Auto fields - Days int - NoSync bool + Days int + NoSync bool + MarkWatched bool } func Parse(version string) *Opts { diff --git a/pkg/help/help.go b/pkg/help/help.go index 8e049b4..70a1969 100644 --- a/pkg/help/help.go +++ b/pkg/help/help.go @@ -70,8 +70,8 @@ func HelpAuto() { pelp.Flags( "flag", - []string{"days", "no-sync"}, - []string{"Maximum number of days to download", "Don't sync"}) + []string{"days", "no-sync", "mark-watched"}, + []string{"Maximum number of days to download", "Don't sync", "Mark videos as watched when rejected"}) } func HelpBinge() { pelp.Print("Select a bunch of videos to download.") diff --git a/pkg/tui/auto.go b/pkg/tui/auto.go index 3153fb0..7255868 100644 --- a/pkg/tui/auto.go +++ b/pkg/tui/auto.go @@ -16,6 +16,7 @@ func parseAutoOpts(opts *argparse.Opts) { flag := flag.NewFlagSet("sinister auto", flag.ExitOnError) flag.IntVar(&opts.Days, "days", 0, "Maximum number of days to download") flag.BoolVar(&opts.NoSync, "no-sync", false, "Disable spinner") + flag.BoolVar(&opts.MarkWatched, "mark-watched", false, "Mark videos as watched when rejected") flag.Usage = help.HelpAuto flag.Parse(opts.Args[1:]) } @@ -44,8 +45,11 @@ func Auto(opts *argparse.Opts) { if softConfirm(fmt.Sprintf("Download %s by %s ?", entry.Title, entry.Author.Name)) { performDownload(opts, &entry) + } else { + if opts.MarkWatched { + database.UpdateWatched(&entry) + } } - } goreland.LogSuccess("All downloads completed!")