Пример #1
0
        internal void EnqueueSong(BeatSaverSharp.Beatmap song, Texture2D cover)
        {
            DownloadQueueItem queuedSong = new DownloadQueueItem(song, cover);

            queueItems.Add(queuedSong);
            _downloadList?.tableView?.ReloadData();
            UpdateDownloadingState(queuedSong);
        }
Пример #2
0
        internal void EnqueueSong(Beatmap song, Sprite cover)
        {
            var queuedSong = new DownloadQueueItem(song, cover);

            queueItems.Add(queuedSong);
            SongDownloader.Instance.QueuedDownload(song.Hash.ToUpper());
            _downloadList?.tableView?.ReloadData();
            UpdateDownloadingState(queuedSong);
        }
Пример #3
0
        internal void EnqueueSong(BeatSaverSharp.Beatmap song, Texture2D cover)
        {
            DownloadQueueItem queuedSong = new DownloadQueueItem(song, cover);

            queueItems.Add(queuedSong);
            Misc.SongDownloader.Instance.QueuedDownload(song.Hash.ToUpper());
            _downloadList?.tableView?.ReloadData();
            UpdateDownloadingState(queuedSong);
        }
Пример #4
0
        internal void DownloadAborted(DownloadQueueItem download)
        {
            if (queueItems.Contains(download))
            {
                queueItems.Remove(download);
            }

            if (queueItems.Count == 0)
            {
                SongCore.Loader.Instance.RefreshSongs(false);
            }
            _downloadList?.tableView?.ReloadData();
        }
Пример #5
0
 internal void UpdateDownloadingState(DownloadQueueItem item)
 {
     foreach (DownloadQueueItem inQueue in queueItems.Where(x => (x as DownloadQueueItem).queueState == SongQueueState.Queued).ToArray())
     {
         if (Misc.PluginConfig.maxSimultaneousDownloads > queueItems.Where(x => (x as DownloadQueueItem).queueState == SongQueueState.Downloading).ToArray().Length)
         {
             inQueue.Download();
         }
     }
     foreach (DownloadQueueItem downloaded in queueItems.Where(x => (x as DownloadQueueItem).queueState == SongQueueState.Downloaded).ToArray())
     {
         queueItems.Remove(downloaded);
         _downloadList?.tableView?.ReloadData();
     }
     if (queueItems.Count == 0)
     {
         SongCore.Loader.Instance.RefreshSongs(false);
     }
 }