示例#1
0
        public ActionResult Index(int p = 1)
        {
            var objCidade = Cidade.Load(GetMyLocationId);

            var objModel = new VideoIndex
            {
                Title                         = "Vídeos - Massa News",
                Description                   = "Assista todos os Vídeos no Massa News.",
                Robots                        = "index, follow",
                Canonical                     = $"{Constants.UrlWeb}/videos",
                ImgOpenGraph                  = $"{Constants.UrlWeb}/content/images/avatar/editorial/avatar-videos.jpg",
                Highlights                    = Noticia.GetBySection(objCidade.Microregion.Home.Id, Section.Videos.Id).Take(3).Select(VideoModel.Map),
                RegionHighlights              = GetRegionHighlights(objCidade.MicroregiaoId),
                SportsHighlights              = GetSportsHighlights(),
                EntertainmentHighlights       = GetEntertainmentHighlights(),
                NegociosDaTerraHighlights     = GetNegociosDaTerraHighlights(),
                BlogsHighlights               = GetBlogHighlights(),
                LiveOnHighlights              = GetLiveOnHighlights(),
                DescobrindoCuritibaHighlights = GetDescobrindoCuritibaHighlights()
            };

            //ViewBag's
            ViewBag.IsVideo     = true;
            ViewBag.ActiveNav   = "Vídeos";
            ViewBag.EditoriaUrl = "videos";

            return(View(objModel));
        }
 public IActionResult Create([FromBody] VideoCreate data)
 {
     try
     {
         var        userData = jwtService.ParseData(this.User);
         VideoIndex result   = videoService.Create(data, userData.UserId);
         return(Ok(result));
     }
     catch (ServiceException e)
     {
         return(BadRequest(e.Message));
     }
 }
示例#3
0
        private async Task <bool> ExecuteAsync()
        {
            bool executedSuccessfully = true;

            try
            {
                if (GetConfigurationValues())
                {
                    _indexerApiUrl = "https://api.videoindexer.ai";
                    //Retrieve _indexerApiKey from secret store
                    _indexerApiKey = "";                     //Add your own credentials here

                    //Get job details
                    IndexJob indexJob = new IndexJob();
                    indexJob = GetSingleJob();


                    if (indexJob.Success)
                    {
                        await UpdateStatus(indexJob, "In Progress");

                        //Get job document details
                        DocProperty doc = new DocProperty();
                        doc = await GetDocProperty(indexJob.WorkspaceArtifactID, indexJob.DocumentArtifactID);

                        if (doc.Success)
                        {
                            //Launch video for indexing
                            VideoIndex       videoIndex       = new VideoIndex(doc.Path, doc.Filename, doc.Begdoc, _indexerApiUrl, _indexerApiKey, _logger, Helper);
                            VideoIndexResult videoIndexResult = await videoIndex.Sample();

                            //Update job with index details.  We will use these details later in the custom page.
                            await WriteValuesToIndexJob(indexJob, videoIndexResult);
                            await WriteValuesToDocumentObject(indexJob, videoIndexResult);

                            //Write transcript to document field
                        }
                        CleanupQueue(indexJob);
                        await UpdateStatus(indexJob, "Complete");
                    }
                }
                const int maxMessageLevel = 10;
                RaiseMessage("Completed.", maxMessageLevel);
            }
            catch (Exception ex)
            {
                LogError(ex);
                executedSuccessfully = false;
            }
            return(executedSuccessfully);
        }