Giter VIP home page Giter VIP logo

sonarrsharp's Introduction

SonarrSharp

C# Sonarr API wrapper.

This project is atm. not actively developed!

Compatibility

Written as a .NET Standard library, so should be compatible with .NET framework, .NET core and Xamarin.

Installation

Available as a NuGet package:

PM> Install-Package SonarrSharp

Known Issues

  • Please tell me! :)

Usage

These are some examples on how to use the API. All methods are async/awaitable. Most methods includes help text on what they do. If you need more information on how the various endpoints works, visit https://github.com/Sonarr/Sonarr/wiki/API.

Create the client:

var sonarrClient = new SonarrClient("127.0.0.1", 8989, "apiKey");

Get all series:

var series = await sonarrClient.Series.GetSeries();
foreach (var item in series)
{
    Console.WriteLine($"{item.Title}");
}

Get all episodes in a series:

var episodes = await sonarrClient.Episode.GetEpisodes(123);
foreach (var item in episodes)
{
    Console.WriteLine($"s{item.SeasonNumber}e{item.EpisodeNumber} - {item.Title}");
}

Get all episodes airing in the next 30 days:

var calendar = await sonarrClient.Calendar.GetCalendar(DateTime.Now, DateTime.Now.AddDays(30));
foreach (var item in calendar)
{
    Console.WriteLine($"{item.AirDate}: {item.Series.Title} - s{item.SeasonNumber}e{item.EpisodeNumber} - {item.Title}");
}

Search for all episodes in a series:

var command = await.sonarrClient.Command.SeriesSearch(123);

// Get status of this started command
Console.WriteLine($"{command.Name}: {command.State}");

sonarrsharp's People

Contributors

hertizch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sonarrsharp's Issues

Multiple issues with deleting episode files

  1. When deleting an episode file, the code is throwing an exception when setting the content type (SonarrClient.cs ~ 385). Probably all delete methods fail because of this (same for issue below).
  2. After you remove that particular line code, the api call is not correct. The "/api" is removed from the url. I can't find it at the moment, but I read somewhere on MSDN that the baseAddress should end with a "/" (so, ".../api/").
  3. HttpClient itself shouldn't be disposed (see: https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/)

Need help with the AddSeries

Hello so basically I'm having trouble with adding the seasons and images aspect to the AddSeries method which in turn makes sonarr crash when I just send an empty "array" I have successfully extracted the required data but its currently in string format as the JSON converter wouldn't work for some reason the only issue is that I don't know how to convert it and to what actual format the sonarr API docs didn't help a ton.
If you could send over some form of sample code of the AddSeries method it would highly increase my success ability.

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.