package cmd import ( "kontor-api-gin/internal/api" "kontor-api-gin/internal/config" "log/slog" "github.com/spf13/cobra" "resty.dev/v3" ) var updateTitleCmd = &cobra.Command{ Use: "update-title", Short: "Update titles", Long: "Update titles", Run: func(cmd *cobra.Command, args []string) { slog.Info("Update titles using server", "server", config.ServerName) client := resty.New() localServer := config.Config.Server[config.ServerName] slog.Info("get token", "url", localServer.Url) token := api.GetToken(client, localServer) api.GetJSON(client, token, localServer, "media/lofis", &api.Medialofis) for _, lofi := range api.Medialofis { if lofi.Review { slog.Info("get title for Url", "url", lofi.WebLink) } } }, } func init() { rootCmd.AddCommand(updateTitleCmd) }