/// <summary> /// Adds a PlaylistSong to the list if a song with the same hash doesn't already exist. /// </summary> /// <param name="song"></param> /// <returns>True if the song was added.</returns> public bool TryAdd(PlaylistSong song) { if (!Songs.Any(s => s.Hash.Equals(song.Hash))) { Songs.Add(song); IsDirty = true; return(true); } return(false); }
public bool TryRemove(PlaylistSong song) { return(TryRemove(song.Hash)); }
/// <summary> /// Attempts to remove the song from all loaded playlists. /// </summary> /// <param name="song"></param> public static void RemoveSongFromAll(PlaylistSong song) { RemoveSongFromAll(song.Hash); }