removed function fetch list
This commit is contained in:
		| @@ -166,41 +166,6 @@ func Fetch(musicObject data.MusicObject) (data.MusicObject, error) { | ||||
| 	return musicObject, nil | ||||
| } | ||||
|  | ||||
| func FetchList(musicObject data.MusicObject) ([]data.MusicObject, error) { | ||||
| 	res := []data.MusicObject{} | ||||
|  | ||||
| 	musicObject, err := Fetch(musicObject) | ||||
| 	if err != nil { | ||||
| 		return res, err | ||||
| 	} | ||||
|  | ||||
| 	if a, ok := musicObject.(data.Song); ok { | ||||
| 		for _, ar := range a.Artists { | ||||
| 			res = append(res, ar) | ||||
| 		} | ||||
| 		if a.Album.Name != "" { | ||||
| 			res = append(res, a.Album, a) | ||||
| 		} | ||||
| 	} else if a, ok := musicObject.(data.Album); ok { | ||||
| 		for _, ar := range a.Artists { | ||||
| 			res = append(res, ar) | ||||
| 		} | ||||
| 		res = append(res, a) | ||||
| 		for _, s := range a.Songs { | ||||
| 			res = append(res, s) | ||||
| 		} | ||||
| 	} else if a, ok := musicObject.(data.Artist); ok { | ||||
| 		res = append(res, a) | ||||
| 		for _, al := range a.Albums { | ||||
| 			res = append(res, al) | ||||
| 		} | ||||
| 	} else { | ||||
| 		res = append(res, musicObject) | ||||
| 	} | ||||
|  | ||||
| 	return res, nil | ||||
| } | ||||
|  | ||||
| type SearchConfig struct { | ||||
| 	IgnoreErrors bool | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user