Exemple #1
0
        public PlayResult Play(string title)
        {
            var song = _album.FindSong(title);

            if (song == null)
            {
                return(new PlayResult.Builder
                {
                    Song = song,
                    Message = "歌が見つかりませんでした。",
                }.Build());
            }

            return(_house.Play(song, 100));
        }
        public IActionResult Play(string songName, [FromQuery] bool cheat = false)
        {
            // 歌検索
            var song = _album.FindSong(songName);

            if (song == null)
            {
                return(new NotFoundResult());
            }

            const int count      = 256;
            var       playResult = cheat
                ? _house.Cheat(song)
                : _house.Play(song, count);

            return(View("~/Views/Home/Play.cshtml", new PlayViewModel
            {
                AppSettings = _appSettings,
                Title = song.Title,
                Song = song,
                PlayResult = playResult,
            }));
        }