Exemplo n.º 1
0
        public Song(BeatSaverSong s, IEnumerable <ScoreSaberDifficulty> scoreSaberDifficulties = null)
            : this()
        {
            SongId      = s._id;
            Key         = s.key.ToLower();
            Name        = s.name;
            Description = s.description;
            DeletedAt   = s.deletedAt;
            Hash        = s.hash.ToUpper();
            Uploaded    = s.uploaded;
            Converted   = s.converted;
            DownloadUrl = s.downloadURL;
            CoverUrl    = s.coverURL;

            SongName        = s.metadata.songName;
            SongSubName     = s.metadata.songSubName;
            SongAuthorName  = s.metadata.songAuthorName;
            LevelAuthorName = s.metadata.levelAuthorName;
            BeatsPerMinute  = s.metadata.bpm;

            Downloads = s.stats.downloads;
            Plays     = s.stats.plays;
            DownVotes = s.stats.downVotes;
            UpVotes   = s.stats.upVotes;
            Heat      = s.stats.heat;
            Rating    = s.stats.rating;

            ScrapedAt = s.ScrapedAt;

            //SongDifficulties = Difficulty.DictionaryToDifficulties(s.metadata.difficulties).
            //    Select(d => new SongDifficulty() { Difficulty = d, Song = this, SongId = s._id }).ToList();
            BeatmapCharacteristics = BeatmapCharacteristic.ConvertFrom(s.metadata.characteristics, this);
            UploaderRefId          = s.uploader.id;
            Uploader = new Uploader()
            {
                UploaderId = UploaderRefId, UploaderName = s.uploader.username
            };
            if (scoreSaberDifficulties != null)
            {
                ScoreSaberDifficulties = scoreSaberDifficulties.ToList();
            }
            else
            {
                ScoreSaberDifficulties = null; // new List<ScoreSaberDifficulty>();
            }
        }
Exemplo n.º 2
0
        public static Song CreateFromBeatSaverSong(BeatSaverSong s, IEnumerable <ScoreSaberDifficulty> scoreSaberDifficulties = null)
        {
            Song song = new Song(s, scoreSaberDifficulties);

            return(song);
        }
Exemplo n.º 3
0
 public bool Equals(BeatSaverSong other)
 {
     return(SongId.ToLower() == other._id);
 }