internal static void StartNewPageSearch() { SongDownloaderUI.ResetScrollPosition(); MelonCoroutines.Start(DoSongWebSearch(searchString, (query, result) => { songlist = result; if (SongDownloaderUI.songItemPanel != null) { SongDownloaderUI.AddSongItems(SongDownloaderUI.songItemMenu, songlist); } }, SongDownloaderUI.difficultyFilter, SongDownloaderUI.popularity, page, false)); }
public static IEnumerator StartSongSearchCoroutine(string search, string difficulty = null, int page = 1, bool total = false) { string webSearch = search == null || search == "" ? "" : "&search=" + WebUtility.UrlEncode(search); string webPage = page == 1 ? "" : "&page=" + page.ToString(); string webDifficulty = difficulty == "All" || difficulty == "" ? "" : "&" + difficulty.ToLower() + "=true"; string webCurated = SongDownloaderUI.curated ? "&curated=true" : ""; string webPlaycount = SongDownloaderUI.popularity ? "&sort=leaderboards" : ""; string concatURL = !total ? apiURL + webSearch + webDifficulty + webPage + webCurated + webPlaycount : "http://www.audica.wiki:5000/api/customsongs?pagesize=all"; WWW www = new WWW(concatURL); yield return(www); songlist = JSON.Load(www.text).Make <APISongList>(); if (SongDownloaderUI.songItemPanel != null) { SongDownloaderUI.AddSongItems(SongDownloaderUI.songItemMenu, songlist); } }