コード例 #1
0
ファイル: SongListController.cs プロジェクト: sethura/vocadb
        public ActionResult CreateFromWVR(CreateFromWVR model, bool commit)
        {
            if (commit)
            {
                var listId = MvcApplication.Services.Rankings.CreateSongListFromWVR(model.Url);
                return(RedirectToAction("Details", "SongList", new { id = listId }));
            }

            WVRListResult parseResult;

            try {
                parseResult = MvcApplication.Services.Rankings.ParseWVRList(model.Url);
            } catch (InvalidFeedException x) {
                ModelState.AddModelError("Url", x);
                return(View(model));
            }
            model.ListResult = parseResult;

            if (parseResult.IsIncomplete)
            {
                ModelState.AddModelError("ListResult", "Some of the songs are missing");
            }

            return(View(model));
        }
コード例 #2
0
        public ActionResult CreateFromWVR(CreateFromWVR model, bool commit)
        {
            if (commit)
            {
                var listId = rankingService.CreateSongListFromWVR(model.Url, model.ParseAll);
                return(RedirectToAction("Details", "SongList", new { id = listId }));
            }

            WVRListResult parseResult;

            try {
                parseResult = rankingService.ParseWVRList(model.Url, model.ParseAll);
            } catch (InvalidFeedException) {
                ModelState.AddModelError("Url", "Check that the URL is valid and points to a NicoNico MyList or RSS feed.");
                return(View(model));
            }
            model.ListResult = parseResult;

            if (parseResult.IsIncomplete)
            {
                ModelState.AddModelError("ListResult", "Some of the songs are missing from VocaDB. You need to add all songs to the database before creating the list.");
            }

            return(View(model));
        }
コード例 #3
0
ファイル: SongListController.cs プロジェクト: sethura/vocadb
        public ActionResult CreateFromWVR()
        {
            var model = new CreateFromWVR();

            return(View(model));
        }