🐛 Init service for caption
This commit is contained in:
1 parent
0bf011f474
commit
19c6a5a6f7
5 files changed
+11
No files matched your search
@@ -14,6 +14,7 @@ var deleteCmd = &cobra.Command{
|
||||
caption.WithId(id),
|
||||
caption.WithOnBehalfOf(onBehalfOf),
|
||||
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
|
||||
caption.WithService(),
|
||||
)
|
||||
c.Delete()
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@ var insertCmd = &cobra.Command{
|
||||
caption.WithOnBehalfOf(onBehalfOf),
|
||||
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
|
||||
caption.WithVideoId(videoId),
|
||||
caption.WithService(),
|
||||
)
|
||||
c.Insert()
|
||||
},
|
||||
|
||||
@@ -15,6 +15,7 @@ var listCmd = &cobra.Command{
|
||||
caption.WithVideoId(videoId),
|
||||
caption.WithOnBehalfOf(onBehalfOf),
|
||||
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
|
||||
caption.WithService(),
|
||||
)
|
||||
c.List(parts, output)
|
||||
},
|
||||
|
||||
@@ -24,6 +24,7 @@ var updateCmd = &cobra.Command{
|
||||
caption.WithOnBehalfOf(onBehalfOf),
|
||||
caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner),
|
||||
caption.WithVideoId(videoId),
|
||||
caption.WithService(),
|
||||
)
|
||||
c.Update()
|
||||
},
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user