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

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