示例#1
0
 protected override void BeginProcessing()
 {
     base.BeginProcessing();
     parameters = new SonarrBodyParameters
     {
         { "name", this.Command }
     };
 }
        protected override void ProcessRecord()
        {
            var newDict = new SonarrBodyParameters(parameters)
            {
                { "seriesId", this.SeriesId }
            };
            string msg = string.Format("Series Id {0}", this.SeriesId);

            if (this.Force.ToBool() || base.ShouldProcess(msg, "Invoke Series Search"))
            {
                base.ProcessRequest(newDict);
            }
        }
示例#3
0
        /// <summary>
        /// Takes in a generic dictionary of parameters and issues a command to Sonarr with the dictionary as its payload.
        /// </summary>
        /// <param name="parameterDict">The set of parameters to build the POST body with,</param>
        protected private void ProcessRequest(SonarrBodyParameters parameterDict)
        {
            object cmdName = parameterDict["name"];
            string verbMsg = string.Format("Issuing command - {0} at {1}", cmdName, BASE_EP);

            base.WriteVerbose(verbMsg);

            CommandOutput output = base.SendSonarrPost <CommandOutput>(BASE_EP, parameterDict);

            if (output != null)
            {
                base.WriteObject(output);
            }
        }
        protected override void ProcessRecord()
        {
            var newDict = new SonarrBodyParameters(parameters)
            {
                { "seriesId", this.SeriesId }
            };

            string msg = "Refresh all series";

            if (this.ContainsParameter(x => x.SeriesId))
            {
                msg = string.Format("Refresh series id {0}", this.SeriesId);
            }
            if (this.Force.ToBool() || base.ShouldProcess(msg, "Invoke"))
            {
                base.ProcessRequest(newDict);
            }
        }