🐛 Init service for caption

This commit is contained in:
chaoqun committed 2024-06-14 22:22:10 +08:00
1 parent 0bf011f474
commit 19c6a5a6f7
5 files changed
+11

No files matched your search

+1
View File
@@ -14,6 +14,7 @@ var deleteCmd = &cobra.Command{
caption.WithId(id),
caption.WithOnBehalfOf(onBehalfOf),
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
caption.WithService(),
)
c.Delete()
},
+1
View File
@@ -24,6 +24,7 @@ var insertCmd = &cobra.Command{
caption.WithOnBehalfOf(onBehalfOf),
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
caption.WithVideoId(videoId),
caption.WithService(),
)
c.Insert()
},
+1
View File
@@ -15,6 +15,7 @@ var listCmd = &cobra.Command{
caption.WithVideoId(videoId),
caption.WithOnBehalfOf(onBehalfOf),
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
caption.WithService(),
)
c.List(parts, output)
},
+1
View File
@@ -24,6 +24,7 @@ var updateCmd = &cobra.Command{
caption.WithOnBehalfOf(onBehalfOf),
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
caption.WithVideoId(videoId),
caption.WithService(),
)
c.Update()
},
+7
View File
@@ -3,6 +3,7 @@ package caption
import (
"errors"
"fmt"
"github.com/eat-pray-ai/yutu/pkg/auth"
"github.com/eat-pray-ai/yutu/pkg/utils"
"google.golang.org/api/youtube/v3"
"log"
@@ -292,3 +293,9 @@ func WithVideoId(videoId string) Option {
c.videoId = videoId
}
}
func WithService() Option {
return func(c *caption) {
service = auth.NewY2BService()
}
}