private static void ParseInnerContent(SearchResult ret, Content content, SearchResultType filter) { SearchResultType type = ContentStaticHelpers.GetSearchResultType(content); int defaultIndex = filter == SearchResultType.All ? 1 : 0; switch (type) { case SearchResultType.Album: ret.Albums.Add(new AlbumResult(content)); break; case SearchResultType.Artist: ret.Artists.Add(new ArtistResult(content)); break; case SearchResultType.Playlist: ret.Playlists.Add(new PlaylistResult(content, defaultIndex)); break; case SearchResultType.Song: ret.Songs.Add(new SongResult(content, defaultIndex)); break; case SearchResultType.Video: ret.Videos.Add(new VideoResult(content, defaultIndex)); break; case SearchResultType.Upload: throw new Exception("We should not be handling Uploads specifically, Uploads should be handled as the type they are (Album, Artist, Song)"); default: throw new Exception($"Unsupported type when parsing generated result: {type}"); } }