mirror of
https://github.com/miniflux/v2.git
synced 2025-06-27 16:36:00 +00:00
refactor(processor): remove a useless type declaration
This commit is contained in:
parent
5cff4d7117
commit
e366710529
1 changed files with 8 additions and 10 deletions
|
@ -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"`
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue