public HttpResponseMessage Post([FromBody] SeasonPass Data)
        {
            JsonResponse Response = new JsonResponse(true, new SecureContext());

            Response.Create();

            if (Response.IsAuthentic == true)
            {
                IContentService Service = Services.ContentService;

                var Pass = Service.CreateContent(EncDecService.Hash(Data.ID), 1121, "seasonPass");
                Pass.SetValue("passID", EncDecService.Hash(Data.ID));
                Pass.SetValue("holderName", EncDecService.Encrypt(Data.Holder));
                Pass.SetValue("validFrom", Convert.ToDateTime(Data.ValidFrom));
                Pass.SetValue("validTo", Convert.ToDateTime(Data.ValidTo));
                Pass.SetValue("acquiredOn", Convert.ToDateTime(Data.AcquiredOn));

                string ResponseMessage;

                if (Service.SaveAndPublishWithStatus(Pass))
                {
                    ResponseMessage = "The content has been successfully saved.";
                }
                else
                {
                    ResponseMessage = "An error occured while saving the season pass.";
                }

                Response.Set(new StringContent(ResponseMessage, ApiContext.GetEncoding(), "text/plain"));
            }

            return(Response.Get());
        }
 public void MapValues()
 {
     ArtifactItem.TryMapValue();
     SealPresentationNode.TryMapValue();
     SeasonalChallengesPresentationNode.TryMapValue();
     SeasonPass.TryMapValue();
     SeasonPassProgression.TryMapValue();
     SeasonPassUnlock.TryMapValue();
 }
 public bool DeepEquals(DestinySeasonDefinition other)
 {
     return(other != null &&
            ArtifactItem.DeepEquals(other.ArtifactItem) &&
            BackgroundImagePath == other.BackgroundImagePath &&
            DisplayProperties.DeepEquals(other.DisplayProperties) &&
            SeasonNumber == other.SeasonNumber &&
            SealPresentationNode.DeepEquals(other.SealPresentationNode) &&
            SeasonalChallengesPresentationNode.DeepEquals(other.SeasonalChallengesPresentationNode) &&
            SeasonPass.DeepEquals(other.SeasonPass) &&
            SeasonPassProgression.DeepEquals(other.SeasonPassProgression) &&
            SeasonPassUnlock.DeepEquals(other.SeasonPassUnlock) &&
            StartTimeInSeconds == other.StartTimeInSeconds &&
            StartDate == other.StartDate &&
            EndDate == other.EndDate &&
            Preview.DeepEquals(other.Preview) &&
            Blacklisted == other.Blacklisted &&
            Hash == other.Hash &&
            Index == other.Index &&
            Redacted == other.Redacted);
 }
Exemple #4
0
        public async Task <bool> SeasonPass(string apiKey, string baseUrl, SonarrSeries series)
        {
            var seasonPass = new SeasonPass
            {
                series = new []
                {
                    series
                },
                monitoringOptions = new Monitoringoptions
                {
                    ignoreEpisodesWithFiles    = false,
                    ignoreEpisodesWithoutFiles = false,
                }
            };
            var request = new Request($"{ApiBaseUrl}seasonpass", baseUrl, HttpMethod.Post);

            request.AddHeader("X-Api-Key", apiKey);
            request.AddJsonBody(seasonPass);

            var content = await Api.RequestContent(request);

            return(content.Equals("ok", StringComparison.CurrentCultureIgnoreCase));
        }
Exemple #5
0
 public Season13Recommendations(IManifest manifest, SeasonPass seasonPass)
     : base(manifest, seasonPass)
 {
 }
 protected Year3Recommendations(IManifest manifest, SeasonPass seasonPass)
     : base(manifest, seasonPass)
 {
 }