Skip to content

Commit

Permalink
refactor: renamed 'tui' to 'manage'
Browse files Browse the repository at this point in the history
  • Loading branch information
pspiagicw committed Jun 20, 2024
1 parent cf05c3a commit bc4a748
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ require (
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8=
Expand Down
4 changes: 2 additions & 2 deletions pkg/database/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func TotalEntries() int {

return total
}
func UnwatchedEntries() int {
func CountUnwatched() int {
db := openDB()

rows := runQuery(db, "SELECT * FROM entries WHERE watched = 0")
Expand All @@ -103,7 +103,7 @@ func UnwatchedEntries() int {

return total
}
func QueryAll() []feed.Entry {
func QueryUnwatched() []feed.Entry {
db := openDB()

rows := runQuery(db, "SELECT * FROM entries WHERE watched = 0")
Expand Down
12 changes: 6 additions & 6 deletions pkg/handle/handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"github.com/pspiagicw/goreland"
"github.com/pspiagicw/sinister/pkg/argparse"
"github.com/pspiagicw/sinister/pkg/help"
"github.com/pspiagicw/sinister/pkg/tui"
"github.com/pspiagicw/sinister/pkg/manage"
)

func Handle(opts *argparse.Opts) {
Expand All @@ -26,11 +26,11 @@ func handleCmd(opts *argparse.Opts) {
"help": func(opts *argparse.Opts) {
help.HandleHelp(opts.Args[1:], opts.Version)
},
"status": tui.Status,
"update": tui.Update,
"download": tui.Download,
"mark": tui.Mark,
"auto": tui.Auto,
"status": manage.Status,
"update": manage.Update,
"download": manage.Download,
"mark": manage.Mark,
"auto": manage.Auto,
}

cmd := opts.Args[0]
Expand Down
4 changes: 2 additions & 2 deletions pkg/tui/auto.go → pkg/manage/auto.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"flag"
Expand Down Expand Up @@ -35,7 +35,7 @@ func Auto(opts *argparse.Opts) {
goreland.LogSuccess("Synching with feeds completed!")
goreland.LogInfo("Downloading videos...")

entries := database.QueryAll()
entries := database.QueryUnwatched()

entries = filterEntries(entries, opts)

Expand Down
4 changes: 2 additions & 2 deletions pkg/tui/binge.go → pkg/manage/binge.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"flag"
Expand All @@ -18,7 +18,7 @@ func Binge(opts *argparse.Opts) {

parseBingeArgs(opts)

entries := database.QueryAll()
entries := database.QueryUnwatched()

names := []string{}

Expand Down
2 changes: 1 addition & 1 deletion pkg/tui/download.go → pkg/manage/download.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"flag"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tui/mark.go → pkg/manage/mark.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"flag"
Expand Down
2 changes: 1 addition & 1 deletion pkg/tui/prompt.go → pkg/manage/prompt.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"github.com/AlecAivazis/survey/v2"
Expand Down
4 changes: 2 additions & 2 deletions pkg/tui/status.go → pkg/manage/status.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"flag"
Expand Down Expand Up @@ -38,7 +38,7 @@ func Status(opts *argparse.Opts) {
fmt.Println("Total Videos: ", totalEntries)
fmt.Println("Total Creators: ", totalCreators)

unwatchedEntries := database.UnwatchedEntries()
unwatchedEntries := database.CountUnwatched()

fmt.Println("Unwatched Videos: ", unwatchedEntries)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/tui/update.go → pkg/manage/update.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package tui
package manage

import (
"encoding/xml"
Expand Down

0 comments on commit bc4a748

Please sign in to comment.