public PCO.PCOSong GetSong(int songiD) { PCO.PCOSong newSong = AllSongs.ContainsKey(songiD) ? AllSongs[songiD] : null; //AllSongs.Find(s => s.ID == songiD); if (newSong == null) { newSong = PCO.PCOSong.GetSong(songiD); if (newSong != null) { _songList.Add(newSong); _songDict.Add(newSong.ID, newSong); UpdateSongs(); } } return(newSong); }
public Dictionary <int, PCO.PCOSong> GetAllSongs() { _songList = new List <PCO.PCOSong>(); _songDict = new Dictionary <int, PCO.PCOSong>(); dynamic DataJSON = ReadData(this.SongDataPath); if (DataJSON != null) { try { foreach (dynamic song in DataJSON) { PCO.PCOSong newSong = new PCO.PCOSong(song, true); _songList.Add(newSong); _songDict.Add(newSong.ID, newSong); } } catch (Exception) { } } return(_songDict); }
public static PCOSong GetSong(int songID) { PCO.PCOSong newSong = GetSong(PCO.PCOSong.PCOUrl(songID)); return(newSong); }