Refactor to use consts instead of string

This commit is contained in:
bytedream 2022-06-24 11:51:48 +02:00
parent 3dcfbc0fbb
commit 79c3ba2636
3 changed files with 8 additions and 8 deletions

View file

@ -23,7 +23,7 @@ func (c *Crunchyroll) Recommendations(limit uint) (s []*Series, m []*Movie, err
for _, item := range jsonBody["items"].([]interface{}) {
switch item.(map[string]interface{})["type"] {
case "series":
case MediaTypeSeries:
series := &Series{
crunchy: c,
}
@ -35,7 +35,7 @@ func (c *Crunchyroll) Recommendations(limit uint) (s []*Series, m []*Movie, err
}
s = append(s, series)
case "movie_listing":
case MediaTypeMovie:
movie := &Movie{
crunchy: c,
}