diff --git a/cmd/caption/delete.go b/cmd/caption/delete.go index c221f88..f7e1739 100644 --- a/cmd/caption/delete.go +++ b/cmd/caption/delete.go @@ -65,7 +65,7 @@ var deleteCmd = &cobra.Command{ Long: deleteLong, Run: func(cmd *cobra.Command, args []string) { input := caption.NewCation( - caption.WithIDs(ids), + caption.WithIds(ids), caption.WithOnBehalfOf(onBehalfOf), caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), ) diff --git a/cmd/caption/download.go b/cmd/caption/download.go index fd527f0..e095818 100644 --- a/cmd/caption/download.go +++ b/cmd/caption/download.go @@ -77,7 +77,7 @@ var downloadCmd = &cobra.Command{ Long: downloadLong, Run: func(cmd *cobra.Command, args []string) { input := caption.NewCation( - caption.WithIDs(ids), + caption.WithIds(ids), caption.WithFile(file), caption.WithTfmt(tfmt), caption.WithTlang(tlang), diff --git a/cmd/caption/list.go b/cmd/caption/list.go index 512f78e..0e99d52 100644 --- a/cmd/caption/list.go +++ b/cmd/caption/list.go @@ -83,7 +83,7 @@ var listCmd = &cobra.Command{ Long: listLong, Run: func(cmd *cobra.Command, args []string) { input := caption.NewCation( - caption.WithIDs(ids), + caption.WithIds(ids), caption.WithVideoId(videoId), caption.WithOnBehalfOf(onBehalfOf), caption.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), diff --git a/cmd/channel/list.go b/cmd/channel/list.go index 460be40..24a1719 100644 --- a/cmd/channel/list.go +++ b/cmd/channel/list.go @@ -22,7 +22,7 @@ const ( listTool = "channel-list" listShort = "List channel's info" listLong = "List channel's info, such as title, description, etc." - listIdsUsage = "Return the channels with the specified IDs" + listIdsUsage = "Return the channels with the specified Ids" ) var listInSchema = &jsonschema.Schema{ @@ -121,7 +121,7 @@ var listCmd = &cobra.Command{ channel.WithForHandle(forHandle), channel.WithForUsername(forUsername), channel.WithHl(hl), - channel.WithIDs(ids), + channel.WithIds(ids), channel.WithChannelManagedByMe(managedByMe), channel.WithMaxResults(maxResults), channel.WithMine(mine), diff --git a/cmd/channel/update.go b/cmd/channel/update.go index 083a565..a6d97bf 100644 --- a/cmd/channel/update.go +++ b/cmd/channel/update.go @@ -82,7 +82,7 @@ var updateCmd = &cobra.Command{ Long: updateLong, Run: func(cmd *cobra.Command, args []string) { input := channel.NewChannel( - channel.WithIDs(ids), + channel.WithIds(ids), channel.WithCountry(country), channel.WithCustomUrl(customUrl), channel.WithDefaultLanguage(defaultLanguage), diff --git a/cmd/channelSection/delete.go b/cmd/channelSection/delete.go index ed8b73f..2e48324 100644 --- a/cmd/channelSection/delete.go +++ b/cmd/channelSection/delete.go @@ -70,7 +70,7 @@ var deleteCmd = &cobra.Command{ Long: deleteLong, Run: func(cmd *cobra.Command, args []string) { input := channelSection.NewChannelSection( - channelSection.WithIDs(ids), + channelSection.WithIds(ids), channelSection.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), ) err := input.Delete(cmd.OutOrStdout()) diff --git a/cmd/channelSection/list.go b/cmd/channelSection/list.go index 2160d86..279919a 100644 --- a/cmd/channelSection/list.go +++ b/cmd/channelSection/list.go @@ -87,7 +87,7 @@ var listCmd = &cobra.Command{ Long: listLong, Run: func(cmd *cobra.Command, args []string) { input := channelSection.NewChannelSection( - channelSection.WithIDs(ids), + channelSection.WithIds(ids), channelSection.WithChannelId(channelId), channelSection.WithHl(hl), channelSection.WithMine(mine), diff --git a/cmd/comment/delete.go b/cmd/comment/delete.go index b37b651..344e160 100644 --- a/cmd/comment/delete.go +++ b/cmd/comment/delete.go @@ -25,7 +25,7 @@ const ( ) type deleteIn struct { - IDs []string `json:"ids"` + Ids []string `json:"ids"` } var deleteInSchema = &jsonschema.Schema{ @@ -85,7 +85,7 @@ func deleteHandler( ), ) - ids = input.IDs + ids = input.Ids var writer bytes.Buffer err := del(&writer) if err != nil { @@ -97,7 +97,7 @@ func deleteHandler( func del(writer io.Writer) error { c := comment.NewComment( - comment.WithIDs(ids), + comment.WithIds(ids), comment.WithService(nil), ) diff --git a/cmd/comment/list.go b/cmd/comment/list.go index e592b7c..1fafe64 100644 --- a/cmd/comment/list.go +++ b/cmd/comment/list.go @@ -27,7 +27,7 @@ const ( ) type listIn struct { - IDs []string `json:"ids"` + Ids []string `json:"ids"` MaxResults int64 `json:"maxResults"` ParentId string `json:"parentId"` TextFormat string `json:"textFormat"` @@ -130,7 +130,7 @@ func listHandler( ), ) - ids = input.IDs + ids = input.Ids maxResults = input.MaxResults parentId = input.ParentId textFormat = input.TextFormat @@ -149,7 +149,7 @@ func listHandler( func list(writer io.Writer) error { c := comment.NewComment( - comment.WithIDs(ids), + comment.WithIds(ids), comment.WithMaxResults(maxResults), comment.WithParentId(parentId), comment.WithTextFormat(textFormat), diff --git a/cmd/comment/markAsSpam.go b/cmd/comment/markAsSpam.go index 113717f..ddfdace 100644 --- a/cmd/comment/markAsSpam.go +++ b/cmd/comment/markAsSpam.go @@ -112,7 +112,7 @@ func markAsSpamHandler( func markAsSpam(writer io.Writer) error { c := comment.NewComment( - comment.WithIDs(ids), + comment.WithIds(ids), comment.WithService(nil), ) diff --git a/cmd/comment/setModerationStatus.go b/cmd/comment/setModerationStatus.go index d4a6b7b..625cc07 100644 --- a/cmd/comment/setModerationStatus.go +++ b/cmd/comment/setModerationStatus.go @@ -139,7 +139,7 @@ func setModerationStatusHandler( func setModerationStatus(writer io.Writer) error { c := comment.NewComment( - comment.WithIDs(ids), + comment.WithIds(ids), comment.WithModerationStatus(moderationStatus), comment.WithBanAuthor(banAuthor), comment.WithService(nil), diff --git a/cmd/comment/update.go b/cmd/comment/update.go index e96de46..6ad0713 100644 --- a/cmd/comment/update.go +++ b/cmd/comment/update.go @@ -141,7 +141,7 @@ func updateHandler( func update(writer io.Writer) error { c := comment.NewComment( - comment.WithIDs(ids), + comment.WithIds(ids), comment.WithCanRate(canRate), comment.WithTextOriginal(textOriginal), comment.WithViewerRating(viewerRating), diff --git a/cmd/commentThread/list.go b/cmd/commentThread/list.go index 73e32fd..201219a 100644 --- a/cmd/commentThread/list.go +++ b/cmd/commentThread/list.go @@ -186,7 +186,7 @@ func listHandler( func list(writer io.Writer) error { ct := commentThread.NewCommentThread( - commentThread.WithIDs(ids), + commentThread.WithIds(ids), commentThread.WithAllThreadsRelatedToChannelId(allThreadsRelatedToChannelId), commentThread.WithChannelId(channelId), commentThread.WithMaxResults(maxResults), diff --git a/cmd/member/member.go b/cmd/member/member.go index a28fa14..5abac44 100644 --- a/cmd/member/member.go +++ b/cmd/member/member.go @@ -11,7 +11,7 @@ import ( const ( short = "List channel's members' info" long = "List channel's members' info, such as channelId, displayName, etc" - mcidUsage = "Comma separated list of channel IDs. Only data about members that are part of this list will be included" + mcidUsage = "Comma separated list of channel Ids. Only data about members that are part of this list will be included" hatlUsage = "Filter members in the results set to the ones that have access to a level" mmUsage = "listMembersModeUnknown, updates, or all_current" ) diff --git a/cmd/playlist/delete.go b/cmd/playlist/delete.go index 04956fc..debc3be 100644 --- a/cmd/playlist/delete.go +++ b/cmd/playlist/delete.go @@ -109,7 +109,7 @@ func deleteHandler( func del(writer io.Writer) error { p := playlist.NewPlaylist( - playlist.WithIDs(ids), + playlist.WithIds(ids), playlist.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), playlist.WithService(nil), ) diff --git a/cmd/playlist/list.go b/cmd/playlist/list.go index f3c5e7d..beeed85 100644 --- a/cmd/playlist/list.go +++ b/cmd/playlist/list.go @@ -24,7 +24,7 @@ const ( listTool = "playlist-list" listShort = "List playlist's info" listLong = "List playlist's info, such as title, description, etc" - listIdsUsage = "Return the playlists with the given IDs for Stubby or Apiary" + listIdsUsage = "Return the playlists with the given Ids for Stubby or Apiary" listCidUsage = "Return the playlists owned by the specified channel id" ) @@ -172,7 +172,7 @@ func listHandler( func list(writer io.Writer) error { p := playlist.NewPlaylist( - playlist.WithIDs(ids), + playlist.WithIds(ids), playlist.WithChannelId(channelId), playlist.WithHl(hl), playlist.WithMaxResults(maxResults), diff --git a/cmd/playlist/update.go b/cmd/playlist/update.go index d523517..9e52089 100644 --- a/cmd/playlist/update.go +++ b/cmd/playlist/update.go @@ -153,7 +153,7 @@ func updateHandler( func update(writer io.Writer) error { p := playlist.NewPlaylist( - playlist.WithIDs(ids), + playlist.WithIds(ids), playlist.WithTitle(title), playlist.WithDescription(description), playlist.WithTags(tags), diff --git a/cmd/playlistImage/delete.go b/cmd/playlistImage/delete.go index 1bdf0b9..1ea1895 100644 --- a/cmd/playlistImage/delete.go +++ b/cmd/playlistImage/delete.go @@ -108,7 +108,7 @@ func deleteHandler( func del(writer io.Writer) error { pi := playlistImage.NewPlaylistImage( - playlistImage.WithIDs(ids), + playlistImage.WithIds(ids), playlistImage.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), playlistImage.WithService(nil), ) diff --git a/cmd/playlistImage/insert.go b/cmd/playlistImage/insert.go index 5c19763..9b6f0ff 100644 --- a/cmd/playlistImage/insert.go +++ b/cmd/playlistImage/insert.go @@ -143,7 +143,7 @@ func insertHandler( func insert(writer io.Writer) error { pi := playlistImage.NewPlaylistImage( playlistImage.WithFile(file), - playlistImage.WithPlaylistID(playlistId), + playlistImage.WithPlaylistId(playlistId), playlistImage.WithType(type_), playlistImage.WithHeight(height), playlistImage.WithWidth(width), diff --git a/cmd/playlistImage/update.go b/cmd/playlistImage/update.go index 6dbbc13..428762f 100644 --- a/cmd/playlistImage/update.go +++ b/cmd/playlistImage/update.go @@ -134,7 +134,7 @@ func updateHandler( func update(writer io.Writer) error { pi := playlistImage.NewPlaylistImage( - playlistImage.WithPlaylistID(playlistId), + playlistImage.WithPlaylistId(playlistId), playlistImage.WithType(type_), playlistImage.WithHeight(height), playlistImage.WithWidth(width), diff --git a/cmd/playlistItem/delete.go b/cmd/playlistItem/delete.go index 9086e24..89b0be9 100644 --- a/cmd/playlistItem/delete.go +++ b/cmd/playlistItem/delete.go @@ -109,7 +109,7 @@ func deleteHandler( func del(writer io.Writer) error { pi := playlistItem.NewPlaylistItem( - playlistItem.WithIDs(ids), + playlistItem.WithIds(ids), playlistItem.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), playlistItem.WithService(nil), ) diff --git a/cmd/playlistItem/list.go b/cmd/playlistItem/list.go index 48e5881..fd5ebbe 100644 --- a/cmd/playlistItem/list.go +++ b/cmd/playlistItem/list.go @@ -155,7 +155,7 @@ func listHandler( func list(writer io.Writer) error { pi := playlistItem.NewPlaylistItem( - playlistItem.WithIDs(ids), + playlistItem.WithIds(ids), playlistItem.WithPlaylistId(playlistId), playlistItem.WithMaxResults(maxResults), playlistItem.WithVideoId(videoId), diff --git a/cmd/playlistItem/update.go b/cmd/playlistItem/update.go index 4351218..1a93cf9 100644 --- a/cmd/playlistItem/update.go +++ b/cmd/playlistItem/update.go @@ -145,7 +145,7 @@ func updateHandler( func update(writer io.Writer) error { pi := playlistItem.NewPlaylistItem( - playlistItem.WithIDs(ids), + playlistItem.WithIds(ids), playlistItem.WithTitle(title), playlistItem.WithDescription(description), playlistItem.WithPrivacy(privacy), diff --git a/cmd/subscription/delete.go b/cmd/subscription/delete.go index da9ce8a..c34c8f4 100644 --- a/cmd/subscription/delete.go +++ b/cmd/subscription/delete.go @@ -98,7 +98,7 @@ func deleteHandler( func del(writer io.Writer) error { s := subscription.NewSubscription( - subscription.WithIDs(ids), subscription.WithService(nil), + subscription.WithIds(ids), subscription.WithService(nil), ) return s.Delete(writer) diff --git a/cmd/subscription/list.go b/cmd/subscription/list.go index f5f443e..23500c6 100644 --- a/cmd/subscription/list.go +++ b/cmd/subscription/list.go @@ -197,7 +197,7 @@ func listHandler( func list(writer io.Writer) error { s := subscription.NewSubscription( - subscription.WithIDs(ids), + subscription.WithIds(ids), subscription.WithChannelId(channelId), subscription.WithForChannelId(forChannelId), subscription.WithMaxResults(maxResults), diff --git a/cmd/video/delete.go b/cmd/video/delete.go index 23d5902..0d73124 100644 --- a/cmd/video/delete.go +++ b/cmd/video/delete.go @@ -97,7 +97,7 @@ func deleteHandler( } func del(writer io.Writer) error { - v := video.NewVideo(video.WithIDs(ids)) + v := video.NewVideo(video.WithIds(ids)) return v.Delete(writer) } diff --git a/cmd/video/getRating.go b/cmd/video/getRating.go index 991a6f5..fdd54f5 100644 --- a/cmd/video/getRating.go +++ b/cmd/video/getRating.go @@ -124,7 +124,7 @@ func getRatingHandler( func getRating(writer io.Writer) error { v := video.NewVideo( - video.WithIDs(ids), + video.WithIds(ids), video.WithOnBehalfOfContentOwner(onBehalfOfContentOwner), video.WithService(nil), ) diff --git a/cmd/video/list.go b/cmd/video/list.go index eb2ab63..9390eb7 100644 --- a/cmd/video/list.go +++ b/cmd/video/list.go @@ -199,7 +199,7 @@ func listHandler( func list(writer io.Writer) error { v := video.NewVideo( - video.WithIDs(ids), + video.WithIds(ids), video.WithChart(chart), video.WithHl(hl), video.WithLocale(locale), diff --git a/cmd/video/rate.go b/cmd/video/rate.go index 302df5e..850edaa 100644 --- a/cmd/video/rate.go +++ b/cmd/video/rate.go @@ -107,7 +107,7 @@ func rateHandler( func rate(writer io.Writer) error { v := video.NewVideo( - video.WithIDs(ids), + video.WithIds(ids), video.WithRating(rating), video.WithService(nil), ) diff --git a/cmd/video/reportAbuse.go b/cmd/video/reportAbuse.go index 731741c..af831e1 100644 --- a/cmd/video/reportAbuse.go +++ b/cmd/video/reportAbuse.go @@ -146,7 +146,7 @@ func reportAbuseHandler( func reportAbuse(writer io.Writer) error { v := video.NewVideo( - video.WithIDs(ids), + video.WithIds(ids), video.WithReasonId(reasonId), video.WithSecondaryReasonId(secondaryReasonId), video.WithComments(comments), diff --git a/cmd/video/update.go b/cmd/video/update.go index a28316a..52bba94 100644 --- a/cmd/video/update.go +++ b/cmd/video/update.go @@ -192,7 +192,7 @@ func updateHandler( func update(writer io.Writer) error { v := video.NewVideo( - video.WithIDs(ids), + video.WithIds(ids), video.WithTitle(title), video.WithDescription(description), video.WithTags(tags), diff --git a/cmd/videoCategory/list.go b/cmd/videoCategory/list.go index f0d56f4..50803e3 100644 --- a/cmd/videoCategory/list.go +++ b/cmd/videoCategory/list.go @@ -85,7 +85,7 @@ func categoriesHandler( func list(writer io.Writer) error { vc := videoCategory.NewVideoCategory( - videoCategory.WithIDs(ids), + videoCategory.WithIds(ids), videoCategory.WithHl(hl), videoCategory.WithRegionCode(regionCode), videoCategory.WithService(nil), diff --git a/pkg/caption/caption.go b/pkg/caption/caption.go index 2383bba..0eec0ec 100644 --- a/pkg/caption/caption.go +++ b/pkg/caption/caption.go @@ -26,7 +26,7 @@ var ( type Caption struct { service *youtube.Service - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` File string `yaml:"file" json:"file"` AudioTrackType string `yaml:"audio_track_type" json:"audio_track_type"` IsAutoSynced *bool `yaml:"is_auto_synced" json:"is_auto_synced"` @@ -71,8 +71,8 @@ func NewCation(opts ...Option) ICaption[youtube.Caption] { func (c *Caption) Get() ([]*youtube.Caption, error) { c.preRun() call := c.service.Captions.List(c.Parts, c.VideoId) - if len(c.IDs) > 0 { - call = call.Id(c.IDs...) + if len(c.Ids) > 0 { + call = call.Id(c.Ids...) } if c.OnBehalfOf != "" { call = call.OnBehalfOf(c.OnBehalfOf) @@ -248,7 +248,7 @@ func (c *Caption) Update(writer io.Writer) error { func (c *Caption) Delete(writer io.Writer) error { c.preRun() - for _, id := range c.IDs { + for _, id := range c.Ids { call := c.service.Captions.Delete(id) if c.OnBehalfOf != "" { call = call.OnBehalfOf(c.OnBehalfOf) @@ -269,7 +269,7 @@ func (c *Caption) Delete(writer io.Writer) error { func (c *Caption) Download(writer io.Writer) error { c.preRun() - call := c.service.Captions.Download(c.IDs[0]) + call := c.service.Captions.Download(c.Ids[0]) if c.Tfmt != "" { call = call.Tfmt(c.Tfmt) } @@ -309,7 +309,7 @@ func (c *Caption) Download(writer io.Writer) error { return errors.Join(errDownloadCaption, err) } - _, _ = fmt.Fprintf(writer, "Caption %s downloaded to %s\n", c.IDs[0], c.File) + _, _ = fmt.Fprintf(writer, "Caption %s downloaded to %s\n", c.Ids[0], c.File) return nil } @@ -322,9 +322,9 @@ func (c *Caption) preRun() { } } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(c *Caption) { - c.IDs = ids + c.Ids = ids } } diff --git a/pkg/caption/caption_test.go b/pkg/caption/caption_test.go index d6be07f..be8e18b 100644 --- a/pkg/caption/caption_test.go +++ b/pkg/caption/caption_test.go @@ -36,7 +36,7 @@ func TestNewCation(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"caption1", "caption2"}), + WithIds([]string{"caption1", "caption2"}), WithFile("/path/to/file.srt"), WithAudioTrackType("primary"), WithIsAutoSynced(&isAutoSyncedTrue), @@ -57,7 +57,7 @@ func TestNewCation(t *testing.T) { }, want: &Caption{ service: svc, - IDs: []string{"caption1", "caption2"}, + Ids: []string{"caption1", "caption2"}, File: "/path/to/file.srt", AudioTrackType: "primary", IsAutoSynced: &isAutoSyncedTrue, @@ -147,14 +147,14 @@ func TestNewCation(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithIDs([]string{"caption1"}), + WithIds([]string{"caption1"}), WithLanguage("fr"), WithVideoId("video456"), WithIsCC(&isCCTrue), }, }, want: &Caption{ - IDs: []string{"caption1"}, + Ids: []string{"caption1"}, Language: "fr", VideoId: "video456", IsCC: &isCCTrue, diff --git a/pkg/channel/channel.go b/pkg/channel/channel.go index 09c7c88..8481329 100644 --- a/pkg/channel/channel.go +++ b/pkg/channel/channel.go @@ -28,7 +28,7 @@ type Channel struct { ForHandle string `yaml:"for_handle" json:"for_handle"` ForUsername string `yaml:"for_username" json:"for_username"` Hl string `yaml:"hl" json:"hl"` - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` ManagedByMe *bool `yaml:"managed_by_me" json:"managed_by_me"` MaxResults int64 `yaml:"max_results" json:"max_results"` Mine *bool `yaml:"mine" json:"mine"` @@ -80,8 +80,8 @@ func (c *Channel) Get() ([]*youtube.Channel, error) { if c.Hl != "" { call = call.Hl(c.Hl) } - if len(c.IDs) > 0 { - call = call.Id(c.IDs...) + if len(c.Ids) > 0 { + call = call.Id(c.Ids...) } if c.ManagedByMe != nil { call = call.ManagedByMe(*c.ManagedByMe) @@ -223,9 +223,9 @@ func WithHl(hl string) Option { } } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(c *Channel) { - c.IDs = ids + c.Ids = ids } } diff --git a/pkg/channel/channel_test.go b/pkg/channel/channel_test.go index 40f5949..468873c 100644 --- a/pkg/channel/channel_test.go +++ b/pkg/channel/channel_test.go @@ -36,7 +36,7 @@ func TestNewChannel(t *testing.T) { WithForHandle("@testhandle"), WithForUsername("testuser"), WithHl("en"), - WithIDs([]string{"channel1", "channel2"}), + WithIds([]string{"channel1", "channel2"}), WithChannelManagedByMe(&managedByMeTrue), WithMaxResults(100), WithMine(&mineTrue), @@ -55,7 +55,7 @@ func TestNewChannel(t *testing.T) { ForHandle: "@testhandle", ForUsername: "testuser", Hl: "en", - IDs: []string{"channel1", "channel2"}, + Ids: []string{"channel1", "channel2"}, ManagedByMe: &managedByMeTrue, MaxResults: 100, Mine: &mineTrue, @@ -163,7 +163,7 @@ func TestNewChannel(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithIDs([]string{"channel1"}), + WithIds([]string{"channel1"}), WithTitle("My Channel"), WithCountry("UK"), WithMaxResults(50), @@ -171,7 +171,7 @@ func TestNewChannel(t *testing.T) { }, }, want: &Channel{ - IDs: []string{"channel1"}, + Ids: []string{"channel1"}, Title: "My Channel", Country: "UK", MaxResults: 50, @@ -186,7 +186,7 @@ func TestNewChannel(t *testing.T) { !reflect.DeepEqual(got.(*Channel).ForHandle, tt.want.(*Channel).ForHandle) || !reflect.DeepEqual(got.(*Channel).ForUsername, tt.want.(*Channel).ForUsername) || !reflect.DeepEqual(got.(*Channel).Hl, tt.want.(*Channel).Hl) || - !reflect.DeepEqual(got.(*Channel).IDs, tt.want.(*Channel).IDs) || + !reflect.DeepEqual(got.(*Channel).Ids, tt.want.(*Channel).Ids) || !reflect.DeepEqual(got.(*Channel).ManagedByMe, tt.want.(*Channel).ManagedByMe) || !reflect.DeepEqual(got.(*Channel).MaxResults, tt.want.(*Channel).MaxResults) || !reflect.DeepEqual(got.(*Channel).Mine, tt.want.(*Channel).Mine) || diff --git a/pkg/channelSection/channelSection.go b/pkg/channelSection/channelSection.go index 67ac641..9fcd871 100644 --- a/pkg/channelSection/channelSection.go +++ b/pkg/channelSection/channelSection.go @@ -22,7 +22,7 @@ var ( type ChannelSection struct { service *youtube.Service - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` ChannelId string `yaml:"channel_id" json:"channel_id"` Hl string `yaml:"hl" json:"hl"` Mine *bool `yaml:"mine" json:"mine"` @@ -58,8 +58,8 @@ func (cs *ChannelSection) Get() ( ) { cs.preRun() call := cs.service.ChannelSections.List(cs.Parts) - if len(cs.IDs) > 0 { - call = call.Id(cs.IDs...) + if len(cs.Ids) > 0 { + call = call.Id(cs.Ids...) } if cs.ChannelId != "" { call = call.ChannelId(cs.ChannelId) @@ -107,7 +107,7 @@ func (cs *ChannelSection) List(writer io.Writer) error { func (cs *ChannelSection) Delete(writer io.Writer) error { cs.preRun() - for _, id := range cs.IDs { + for _, id := range cs.Ids { call := cs.service.ChannelSections.Delete(id) if cs.OnBehalfOfContentOwner != "" { call = call.OnBehalfOfContentOwner(cs.OnBehalfOfContentOwner) @@ -132,9 +132,9 @@ func (cs *ChannelSection) preRun() { } } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(cs *ChannelSection) { - cs.IDs = ids + cs.Ids = ids } } diff --git a/pkg/channelSection/channelSection_test.go b/pkg/channelSection/channelSection_test.go index 1da57e5..f255396 100644 --- a/pkg/channelSection/channelSection_test.go +++ b/pkg/channelSection/channelSection_test.go @@ -28,7 +28,7 @@ func TestNewChannelSection(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"section1", "section2"}), + WithIds([]string{"section1", "section2"}), WithChannelId("channel123"), WithHl("en"), WithMine(&mineTrue), @@ -37,7 +37,7 @@ func TestNewChannelSection(t *testing.T) { }, }, want: &ChannelSection{ - IDs: []string{"section1", "section2"}, + Ids: []string{"section1", "section2"}, ChannelId: "channel123", Hl: "en", Mine: &mineTrue, @@ -91,13 +91,13 @@ func TestNewChannelSection(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithIDs([]string{"section1"}), + WithIds([]string{"section1"}), WithChannelId("partialChannel"), WithHl("fr"), }, }, want: &ChannelSection{ - IDs: []string{"section1"}, + Ids: []string{"section1"}, ChannelId: "partialChannel", Hl: "fr", }, diff --git a/pkg/comment/comment.go b/pkg/comment/comment.go index a3fbcf5..d087b41 100644 --- a/pkg/comment/comment.go +++ b/pkg/comment/comment.go @@ -27,7 +27,7 @@ var ( ) type comment struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` AuthorChannelId string `yaml:"author_channel_id" json:"author_channel_id"` CanRate *bool `yaml:"can_rate" json:"can_rate"` ChannelId string `yaml:"channel_id" json:"channel_id"` @@ -65,8 +65,8 @@ func NewComment(opts ...Option) Comment[youtube.Comment] { func (c *comment) Get(parts []string) ([]*youtube.Comment, error) { call := service.Comments.List(parts) - if c.IDs[0] != "" { - call = call.Id(c.IDs...) + if c.Ids[0] != "" { + call = call.Id(c.Ids...) } if c.ParentId != "" { call = call.ParentId(c.ParentId) @@ -208,7 +208,7 @@ func (c *comment) Update(output string, jsonpath string, writer io.Writer) error func (c *comment) MarkAsSpam( output string, jsonpath string, writer io.Writer, ) error { - call := service.Comments.MarkAsSpam(c.IDs) + call := service.Comments.MarkAsSpam(c.Ids) err := call.Do() if err != nil { return errors.Join(errMarkAsSpam, err) @@ -221,7 +221,7 @@ func (c *comment) MarkAsSpam( utils.PrintYAML(c, jsonpath, writer) case "silent": default: - _, _ = fmt.Fprintf(writer, "Comment marked as spam: %s\n", c.IDs) + _, _ = fmt.Fprintf(writer, "Comment marked as spam: %s\n", c.Ids) } return nil } @@ -229,7 +229,7 @@ func (c *comment) MarkAsSpam( func (c *comment) SetModerationStatus( output string, jsonpath string, writer io.Writer, ) error { - call := service.Comments.SetModerationStatus(c.IDs, c.ModerationStatus) + call := service.Comments.SetModerationStatus(c.Ids, c.ModerationStatus) if c.BanAuthor != nil { call = call.BanAuthor(*c.BanAuthor) @@ -249,14 +249,14 @@ func (c *comment) SetModerationStatus( default: _, _ = fmt.Fprintf( writer, "Comment moderation status set to %s: %s\n", - c.ModerationStatus, c.IDs, + c.ModerationStatus, c.Ids, ) } return nil } func (c *comment) Delete(writer io.Writer) error { - for _, id := range c.IDs { + for _, id := range c.Ids { call := service.Comments.Delete(id) err := call.Do() if err != nil { @@ -267,9 +267,9 @@ func (c *comment) Delete(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(c *comment) { - c.IDs = ids + c.Ids = ids } } diff --git a/pkg/comment/comment_test.go b/pkg/comment/comment_test.go index ddc788f..c8429a9 100644 --- a/pkg/comment/comment_test.go +++ b/pkg/comment/comment_test.go @@ -30,7 +30,7 @@ func TestNewComment(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"comment1", "comment2"}), + WithIds([]string{"comment1", "comment2"}), WithAuthorChannelId("author123"), WithCanRate(&canRateTrue), WithChannelId("channel123"), @@ -46,7 +46,7 @@ func TestNewComment(t *testing.T) { }, }, want: &comment{ - IDs: []string{"comment1", "comment2"}, + Ids: []string{"comment1", "comment2"}, AuthorChannelId: "author123", CanRate: &canRateTrue, ChannelId: "channel123", @@ -141,14 +141,14 @@ func TestNewComment(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithIDs([]string{"comment1"}), + WithIds([]string{"comment1"}), WithTextOriginal("Partial comment"), WithVideoId("video456"), WithMaxResults(25), }, }, want: &comment{ - IDs: []string{"comment1"}, + Ids: []string{"comment1"}, TextOriginal: "Partial comment", VideoId: "video456", MaxResults: 25, diff --git a/pkg/commentThread/commentThread.go b/pkg/commentThread/commentThread.go index c3c458f..ebb21a1 100644 --- a/pkg/commentThread/commentThread.go +++ b/pkg/commentThread/commentThread.go @@ -23,7 +23,7 @@ var ( ) type commentThread struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` AllThreadsRelatedToChannelId string `yaml:"all_threads_related_to_channel_id" json:"all_threads_related_to_channel_id"` AuthorChannelId string `yaml:"author_channel_id" json:"author_channel_id"` ChannelId string `yaml:"channel_id" json:"channel_id"` @@ -56,8 +56,8 @@ func NewCommentThread(opts ...Option) CommentThread[youtube.CommentThread] { func (c *commentThread) Get(parts []string) ([]*youtube.CommentThread, error) { call := service.CommentThreads.List(parts) - if len(c.IDs) > 0 { - call = call.Id(c.IDs...) + if len(c.Ids) > 0 { + call = call.Id(c.Ids...) } if c.AllThreadsRelatedToChannelId != "" { call = call.AllThreadsRelatedToChannelId(c.AllThreadsRelatedToChannelId) @@ -191,9 +191,9 @@ func WithChannelId(channelId string) Option { } } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(c *commentThread) { - c.IDs = ids + c.Ids = ids } } diff --git a/pkg/commentThread/commentThread_test.go b/pkg/commentThread/commentThread_test.go index afe1aa2..9643243 100644 --- a/pkg/commentThread/commentThread_test.go +++ b/pkg/commentThread/commentThread_test.go @@ -25,7 +25,7 @@ func TestNewCommentThread(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"thread1", "thread2"}), + WithIds([]string{"thread1", "thread2"}), WithAllThreadsRelatedToChannelId("relatedChannel123"), WithAuthorChannelId("author123"), WithChannelId("channel123"), @@ -40,7 +40,7 @@ func TestNewCommentThread(t *testing.T) { }, }, want: &commentThread{ - IDs: []string{"thread1", "thread2"}, + Ids: []string{"thread1", "thread2"}, AllThreadsRelatedToChannelId: "relatedChannel123", AuthorChannelId: "author123", ChannelId: "channel123", @@ -113,14 +113,14 @@ func TestNewCommentThread(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithIDs([]string{"thread1"}), + WithIds([]string{"thread1"}), WithVideoId("video456"), WithTextOriginal("Partial comment thread"), WithMaxResults(50), }, }, want: &commentThread{ - IDs: []string{"thread1"}, + Ids: []string{"thread1"}, VideoId: "video456", TextOriginal: "Partial comment thread", MaxResults: 50, diff --git a/pkg/playlist/playlist.go b/pkg/playlist/playlist.go index 15a28fa..b3f46b8 100644 --- a/pkg/playlist/playlist.go +++ b/pkg/playlist/playlist.go @@ -25,7 +25,7 @@ var ( ) type playlist struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` Title string `yaml:"title" json:"title"` Description string `yaml:"description" json:"description"` Hl string `yaml:"hl" json:"hl"` @@ -63,8 +63,8 @@ func NewPlaylist(opts ...Option) Playlist[youtube.Playlist] { func (p *playlist) Get(parts []string) ([]*youtube.Playlist, error) { call := service.Playlists.List(parts) - if len(p.IDs) > 0 { - call = call.Id(p.IDs...) + if len(p.Ids) > 0 { + call = call.Id(p.Ids...) } if p.Hl != "" { call = call.Hl(p.Hl) @@ -206,7 +206,7 @@ func (p *playlist) Update(output string, jsonpath string, writer io.Writer) erro } func (p *playlist) Delete(writer io.Writer) error { - for _, id := range p.IDs { + for _, id := range p.Ids { call := service.Playlists.Delete(id) if p.OnBehalfOfContentOwner != "" { call = call.OnBehalfOfContentOwner(p.OnBehalfOfContentOwner) @@ -221,9 +221,9 @@ func (p *playlist) Delete(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(p *playlist) { - p.IDs = ids + p.Ids = ids } } diff --git a/pkg/playlist/playlist_test.go b/pkg/playlist/playlist_test.go index 89660c7..fc84b0f 100644 --- a/pkg/playlist/playlist_test.go +++ b/pkg/playlist/playlist_test.go @@ -28,7 +28,7 @@ func TestNewPlaylist(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"playlist1", "playlist2"}), + WithIds([]string{"playlist1", "playlist2"}), WithTitle("Test Playlist"), WithDescription("Test playlist description"), WithTags([]string{"tag1", "tag2", "tag3"}), @@ -44,7 +44,7 @@ func TestNewPlaylist(t *testing.T) { }, }, want: &playlist{ - IDs: []string{"playlist1", "playlist2"}, + Ids: []string{"playlist1", "playlist2"}, Title: "Test Playlist", Description: "Test playlist description", Tags: []string{"tag1", "tag2", "tag3"}, diff --git a/pkg/playlistImage/playlistImage.go b/pkg/playlistImage/playlistImage.go index 708c092..d8ee7a3 100644 --- a/pkg/playlistImage/playlistImage.go +++ b/pkg/playlistImage/playlistImage.go @@ -26,9 +26,9 @@ var ( ) type playlistImage struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` Height int64 `yaml:"height" json:"height"` - PlaylistID string `yaml:"playlistId" json:"playlistId"` + PlaylistId string `yaml:"playlistId" json:"playlistId"` Type string `yaml:"type" json:"type"` Width int64 `yaml:"width" json:"width"` File string `yaml:"file" json:"file"` @@ -137,7 +137,7 @@ func (pi *playlistImage) Insert( playlistImage := &youtube.PlaylistImage{ Kind: "youtube#playlistImages", Snippet: &youtube.PlaylistImageSnippet{ - PlaylistId: pi.PlaylistID, + PlaylistId: pi.PlaylistId, Type: pi.Type, Height: pi.Height, Width: pi.Width, @@ -182,8 +182,8 @@ func (pi *playlistImage) Update( } playlistImage := playlistImages[0] - if pi.PlaylistID != "" { - playlistImage.Snippet.PlaylistId = pi.PlaylistID + if pi.PlaylistId != "" { + playlistImage.Snippet.PlaylistId = pi.PlaylistId } if pi.Type != "" { playlistImage.Snippet.Type = pi.Type @@ -229,7 +229,7 @@ func (pi *playlistImage) Update( } func (pi *playlistImage) Delete(writer io.Writer) error { - for _, id := range pi.IDs { + for _, id := range pi.Ids { call := service.PlaylistImages.Delete() call = call.Id(id) if pi.OnBehalfOfContentOwner != "" { @@ -245,9 +245,9 @@ func (pi *playlistImage) Delete(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(pi *playlistImage) { - pi.IDs = ids + pi.Ids = ids } } @@ -257,9 +257,9 @@ func WithHeight(height int64) Option { } } -func WithPlaylistID(playlistID string) Option { +func WithPlaylistId(playlistId string) Option { return func(pi *playlistImage) { - pi.PlaylistID = playlistID + pi.PlaylistId = playlistId } } diff --git a/pkg/playlistImage/playlistImage_test.go b/pkg/playlistImage/playlistImage_test.go index 38d007c..d4bdb79 100644 --- a/pkg/playlistImage/playlistImage_test.go +++ b/pkg/playlistImage/playlistImage_test.go @@ -25,9 +25,9 @@ func TestNewPlaylistImage(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"image1", "image2"}), + WithIds([]string{"image1", "image2"}), WithHeight(1080), - WithPlaylistID("playlist123"), + WithPlaylistId("playlist123"), WithType("hero"), WithWidth(1920), WithFile("/path/to/image.jpg"), @@ -39,9 +39,9 @@ func TestNewPlaylistImage(t *testing.T) { }, }, want: &playlistImage{ - IDs: []string{"image1", "image2"}, + Ids: []string{"image1", "image2"}, Height: 1080, - PlaylistID: "playlist123", + PlaylistId: "playlist123", Type: "hero", Width: 1920, File: "/path/to/image.jpg", @@ -84,7 +84,7 @@ func TestNewPlaylistImage(t *testing.T) { name: "with empty string values", args: args{ opts: []Option{ - WithPlaylistID(""), + WithPlaylistId(""), WithType(""), WithFile(""), WithParent(""), @@ -93,7 +93,7 @@ func TestNewPlaylistImage(t *testing.T) { }, }, want: &playlistImage{ - PlaylistID: "", + PlaylistId: "", Type: "", File: "", Parent: "", @@ -105,14 +105,14 @@ func TestNewPlaylistImage(t *testing.T) { name: "with partial options", args: args{ opts: []Option{ - WithPlaylistID("myPlaylist"), + WithPlaylistId("myPlaylist"), WithType("hero"), WithFile("/images/hero.png"), WithMaxResults(25), }, }, want: &playlistImage{ - PlaylistID: "myPlaylist", + PlaylistId: "myPlaylist", Type: "hero", File: "/images/hero.png", MaxResults: 25, diff --git a/pkg/playlistItem/playlistItem.go b/pkg/playlistItem/playlistItem.go index 2bdc088..e569bf9 100644 --- a/pkg/playlistItem/playlistItem.go +++ b/pkg/playlistItem/playlistItem.go @@ -25,7 +25,7 @@ var ( ) type playlistItem struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` Title string `yaml:"title" json:"title"` Description string `yaml:"description" json:"description"` Kind string `yaml:"kind" json:"kind"` @@ -63,8 +63,8 @@ func NewPlaylistItem(opts ...Option) PlaylistItem[youtube.PlaylistItem] { func (pi *playlistItem) Get(parts []string) ([]*youtube.PlaylistItem, error) { call := service.PlaylistItems.List(parts) - if len(pi.IDs) > 0 { - call = call.Id(pi.IDs...) + if len(pi.Ids) > 0 { + call = call.Id(pi.Ids...) } if pi.PlaylistId != "" { call = call.PlaylistId(pi.PlaylistId) @@ -245,7 +245,7 @@ func (pi *playlistItem) Update( } func (pi *playlistItem) Delete(writer io.Writer) error { - for _, id := range pi.IDs { + for _, id := range pi.Ids { call := service.PlaylistItems.Delete(id) if pi.OnBehalfOfContentOwner != "" { call = call.OnBehalfOfContentOwner(pi.OnBehalfOfContentOwner) @@ -261,9 +261,9 @@ func (pi *playlistItem) Delete(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(p *playlistItem) { - p.IDs = ids + p.Ids = ids } } diff --git a/pkg/playlistItem/playlistItem_test.go b/pkg/playlistItem/playlistItem_test.go index b74d87e..65cfd1d 100644 --- a/pkg/playlistItem/playlistItem_test.go +++ b/pkg/playlistItem/playlistItem_test.go @@ -25,7 +25,7 @@ func TestNewPlaylistItem(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"item1", "item2"}), + WithIds([]string{"item1", "item2"}), WithTitle("Test Item"), WithDescription("Test item description"), WithKind("video"), @@ -42,7 +42,7 @@ func TestNewPlaylistItem(t *testing.T) { }, }, want: &playlistItem{ - IDs: []string{"item1", "item2"}, + Ids: []string{"item1", "item2"}, Title: "Test Item", Description: "Test item description", Kind: "video", diff --git a/pkg/subscription/subscription.go b/pkg/subscription/subscription.go index 38989d3..d6d6a00 100644 --- a/pkg/subscription/subscription.go +++ b/pkg/subscription/subscription.go @@ -24,7 +24,7 @@ var ( ) type subscription struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` SubscriberChannelId string `yaml:"subscriber_channel_id" json:"subscriber_channel_id"` Description string `yaml:"description" json:"description"` ChannelId string `yaml:"channel_id" json:"channel_id"` @@ -60,8 +60,8 @@ func NewSubscription(opts ...Option) Subscription[youtube.Subscription] { func (s *subscription) Get(parts []string) ([]*youtube.Subscription, error) { call := service.Subscriptions.List(parts) - if len(s.IDs) > 0 { - call = call.Id(s.IDs...) + if len(s.Ids) > 0 { + call = call.Id(s.Ids...) } if s.ChannelId != "" { call = call.ChannelId(s.ChannelId) @@ -183,7 +183,7 @@ func (s *subscription) Insert( } func (s *subscription) Delete(writer io.Writer) error { - for _, id := range s.IDs { + for _, id := range s.Ids { call := service.Subscriptions.Delete(id) err := call.Do() if err != nil { @@ -195,9 +195,9 @@ func (s *subscription) Delete(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(s *subscription) { - s.IDs = ids + s.Ids = ids } } diff --git a/pkg/subscription/subscription_test.go b/pkg/subscription/subscription_test.go index fad2866..776bdb3 100644 --- a/pkg/subscription/subscription_test.go +++ b/pkg/subscription/subscription_test.go @@ -32,7 +32,7 @@ func TestNewSubscription(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"sub1", "sub2"}), + WithIds([]string{"sub1", "sub2"}), WithSubscriberChannelId("subscriber123"), WithDescription("Test subscription description"), WithChannelId("channel123"), @@ -49,7 +49,7 @@ func TestNewSubscription(t *testing.T) { }, }, want: &subscription{ - IDs: []string{"sub1", "sub2"}, + Ids: []string{"sub1", "sub2"}, SubscriberChannelId: "subscriber123", Description: "Test subscription description", ChannelId: "channel123", diff --git a/pkg/video/video.go b/pkg/video/video.go index b0087d0..cb1a56c 100644 --- a/pkg/video/video.go +++ b/pkg/video/video.go @@ -33,7 +33,7 @@ var ( ) type video struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` AutoLevels *bool `yaml:"auto_levels" json:"auto_levels"` File string `yaml:"file" json:"file"` Title string `yaml:"title" json:"title"` @@ -93,8 +93,8 @@ func NewVideo(opts ...Option) Video[youtube.Video] { func (v *video) Get(parts []string) ([]*youtube.Video, error) { call := service.Videos.List(parts) - if len(v.IDs) > 0 { - call = call.Id(v.IDs...) + if len(v.Ids) > 0 { + call = call.Id(v.Ids...) } if v.Chart != "" { call = call.Chart(v.Chart) @@ -370,7 +370,7 @@ func (v *video) Update(output string, jsonpath string, writer io.Writer) error { } func (v *video) Rate(writer io.Writer) error { - for _, id := range v.IDs { + for _, id := range v.Ids { call := service.Videos.Rate(id, v.Rating) err := call.Do() if err != nil { @@ -382,7 +382,7 @@ func (v *video) Rate(writer io.Writer) error { } func (v *video) GetRating(output string, jsonpath string, writer io.Writer) error { - call := service.Videos.GetRating(v.IDs) + call := service.Videos.GetRating(v.Ids) if v.OnBehalfOfContentOwner != "" { call = call.OnBehalfOfContentOwner(v.OnBehalfOfContentOwnerChannel) } @@ -410,7 +410,7 @@ func (v *video) GetRating(output string, jsonpath string, writer io.Writer) erro } func (v *video) Delete(writer io.Writer) error { - for _, id := range v.IDs { + for _, id := range v.Ids { call := service.Videos.Delete(id) if v.OnBehalfOfContentOwner != "" { call = call.OnBehalfOfContentOwner(v.OnBehalfOfContentOwner) @@ -426,7 +426,7 @@ func (v *video) Delete(writer io.Writer) error { } func (v *video) ReportAbuse(writer io.Writer) error { - for _, id := range v.IDs { + for _, id := range v.Ids { videoAbuseReport := &youtube.VideoAbuseReport{ Comments: v.Comments, Language: v.Language, @@ -450,9 +450,9 @@ func (v *video) ReportAbuse(writer io.Writer) error { return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(v *video) { - v.IDs = ids + v.Ids = ids } } diff --git a/pkg/video/video_test.go b/pkg/video/video_test.go index b8e5ebc..7dc5be3 100644 --- a/pkg/video/video_test.go +++ b/pkg/video/video_test.go @@ -38,7 +38,7 @@ func TestNewVideo(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"video1", "video2"}), + WithIds([]string{"video1", "video2"}), WithAutoLevels(&autoLevelsTrue), WithFile("/path/to/video.mp4"), WithTitle("Test Video"), @@ -74,7 +74,7 @@ func TestNewVideo(t *testing.T) { }, }, want: &video{ - IDs: []string{"video1", "video2"}, + Ids: []string{"video1", "video2"}, AutoLevels: &autoLevelsTrue, File: "/path/to/video.mp4", Title: "Test Video", diff --git a/pkg/videoCategory/videoCategory.go b/pkg/videoCategory/videoCategory.go index 456817c..40ae521 100644 --- a/pkg/videoCategory/videoCategory.go +++ b/pkg/videoCategory/videoCategory.go @@ -20,7 +20,7 @@ var ( ) type videoCategory struct { - IDs []string `yaml:"ids" json:"ids"` + Ids []string `yaml:"ids" json:"ids"` Hl string `yaml:"hl" json:"hl"` RegionCode string `yaml:"region_code" json:"region_code"` } @@ -42,8 +42,8 @@ func NewVideoCategory(opt ...Option) VideoCategory[youtube.VideoCategory] { func (vc *videoCategory) Get(parts []string) ([]*youtube.VideoCategory, error) { call := service.VideoCategories.List(parts) - if len(vc.IDs) > 0 { - call = call.Id(vc.IDs...) + if len(vc.Ids) > 0 { + call = call.Id(vc.Ids...) } if vc.Hl != "" { call = call.Hl(vc.Hl) @@ -86,9 +86,9 @@ func (vc *videoCategory) List( return nil } -func WithIDs(ids []string) Option { +func WithIds(ids []string) Option { return func(vc *videoCategory) { - vc.IDs = ids + vc.Ids = ids } } diff --git a/pkg/videoCategory/videoCategory_test.go b/pkg/videoCategory/videoCategory_test.go index 8cea173..25c2a1b 100644 --- a/pkg/videoCategory/videoCategory_test.go +++ b/pkg/videoCategory/videoCategory_test.go @@ -24,14 +24,14 @@ func TestNewVideoCategory(t *testing.T) { name: "with all options", args: args{ opts: []Option{ - WithIDs([]string{"cat1", "cat2"}), + WithIds([]string{"cat1", "cat2"}), WithHl("en"), WithRegionCode("US"), WithService(&youtube.Service{}), }, }, want: &videoCategory{ - IDs: []string{"cat1", "cat2"}, + Ids: []string{"cat1", "cat2"}, Hl: "en", RegionCode: "US", },