Non API Methods - Yevrag35/SonarrClass GitHub Wiki
There are a couple of the methods that don't actually issue API calls. Here they are outlined:
- GetApiKey()
-- Retrieves previously stored API key from the user's current registry. - SaveApiKey()
-- Stores the API key (plain-text) into an encrypted, hashed binary form in the current user's registry.- NOTE - Only the user who stored the key on the computer it was stored can decrypt the ApiKey from the registry. It is not possible to move or transfer the key in its encrypted form.
- FormatUri()
-- Used to ease the burden of re-writing the same pieces of code when making the API methods.- e.g. - instead of writing a method using:
$($this.SonarrUrl)+'/api/episode?seriesId=18&apikey='+$($this.ApiKey)
it can be called by simply using:$this.FormatUri("episode", "seriesId", 18)
- e.g. - instead of writing a method using:
- ToJson()
-- Converts a string or hashtable into a usable JSON block easily.- can simply be called with:
- $json = $this.ToJson(@{
Name = "SearchSeries"
seriesId = 18
seasonNumber = 1
})
- $json = $this.ToJson(@{
- can simply be called with: