From e366710529980edc89c5fc1f55ef1232dfe91d39 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Wed, 18 Jun 2025 22:31:19 +0200 Subject: [PATCH] refactor(processor): remove a useless type declaration --- internal/reader/processor/youtube.go | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/internal/reader/processor/youtube.go b/internal/reader/processor/youtube.go index 64928a8d..51c5b860 100644 --- a/internal/reader/processor/youtube.go +++ b/internal/reader/processor/youtube.go @@ -142,7 +142,14 @@ func fetchYouTubeWatchTimeFromApiInBulk(videoIDs []string) (map[string]time.Dura return nil, localizedError.Error() } - var videos youtubeVideoListResponse + videos := struct { + Items []struct { + ID string `json:"id"` + ContentDetails struct { + Duration string `json:"duration"` + } `json:"contentDetails"` + } `json:"items"` + }{} if err := json.NewDecoder(responseHandler.Body(config.Opts.HTTPClientMaxBodySize())).Decode(&videos); err != nil { return nil, fmt.Errorf("youtube: unable to decode JSON: %v", err) } @@ -158,12 +165,3 @@ func fetchYouTubeWatchTimeFromApiInBulk(videoIDs []string) (map[string]time.Dura } return watchTimeMap, nil } - -type youtubeVideoListResponse struct { - Items []struct { - ID string `json:"id"` - ContentDetails struct { - Duration string `json:"duration"` - } `json:"contentDetails"` - } `json:"items"` -}