feat: add auto playlist/track recognize

This commit is contained in:
2026-02-12 19:17:33 +01:00
parent 9b8ad87eca
commit 39891b88fc
2 changed files with 59 additions and 47 deletions

20
main.go
View File

@@ -6,7 +6,6 @@ import (
"os"
"github.com/Superredstone/spotiflac-cli/app"
"github.com/Superredstone/spotiflac-cli/lib"
"github.com/Superredstone/spotiflac-cli/pkg"
"github.com/urfave/cli/v3"
)
@@ -14,7 +13,6 @@ import (
func main() {
var song_url string
application := app.NewApp()
startup()
cmd := &cli.Command{
Name: "spotiflac-cli",
@@ -26,25 +24,11 @@ func main() {
},
},
Action: func(ctx context.Context, cmd *cli.Command) error {
pkg.Download(application, song_url)
return nil
err := pkg.Download(application, song_url)
return err
},
}
if err := cmd.Run(context.Background(), os.Args); err != nil {
log.Fatal(err)
shutdown()
}
shutdown()
}
func startup() {
if err := lib.InitHistoryDB("SpotiFLAC"); err != nil {
log.Fatal("Failed to init history DB: %v\n", err)
}
}
func shutdown() {
lib.CloseHistoryDB()
}