/// <summary> /// Acquire the results from the download handler. /// </summary> /// <param name="handler"></param> public void HandleDownloadResults(DownloadHandler handler) { if (Data == null) { Data = (handler as CacheableBeatStarDownloaderHandler).DataFile; } _firstSuccess = true; }
/// <summary> /// Helper to download both databases. They will be stacked together, ranked is more updated. /// </summary> /// <returns></returns> private IEnumerator DownloadBeatStarDatabases() { Data = null; _isDownloading = true; _cancelRequested = false; yield return(DownloadDatabase(SCRAPED_SCORE_SABER_ALL_JSON_URL, this)); _isDownloading = false; }
/// <summary> /// Cancel and Wait for any existing operations to complete then clean up. /// </summary> /// <returns></returns> private IEnumerator WaitAndUnload() { yield return(StartCoroutine(CancelDownload())); if (Data != null) { //Plugin.Log.Debug($"BeatSaber Total Memory - Before BeatStar Unload: {GC.GetTotalMemory(false)}"); Data = null; System.GC.Collect(); //Plugin.Log.Debug($"BeatSaber Total Memory - After BeatStar Unload: {GC.GetTotalMemory(false)}"); } else { Plugin.Log.Debug("BeatStar Database not loaded..."); } }