Beispiel #1
0
        public virtual FavoriteSongForUser AddSongToFavorites(Song song, SongVoteRating rating)
        {
            ParamIs.NotNull(() => song);

            var link = new FavoriteSongForUser(this, song, rating);

            FavoriteSongs.Add(link);
            song.UserFavorites.Add(link);

            if (rating == SongVoteRating.Favorite)
            {
                song.FavoritedTimes++;
            }

            song.RatingScore += FavoriteSongForUser.GetRatingScore(rating);

            return(link);
        }
Beispiel #2
0
 public void AddFavoriteSong(Song song)
 {
     FavoriteSongs.Add(song);
     DBManager.AddSong(song, "_FavoriteSongs_");
 }