golift / starr

Starr Library: Fully functional go package to interact with Lidarr, Prowlarr, Radarr, Readarr, and Sonarr APIs.
https://golift.io/discord
MIT License
69 stars 18 forks source link

Add `GetEpisodeByID` and `GetEpisodeByIDContext` to Sonarr client #115

Closed rtrox closed 1 year ago

rtrox commented 1 year ago

Per Title -- this PR adds GetEpisodeByID & Context variant. Tested locally, I'm able to collect an Episode by it's ID.

davidnewhall commented 1 year ago

You want to try to put together a test? Bummer that file has no examples to copy/paste. :(

rtrox commented 1 year ago

Yep, np -- Just pushed an updated Commit with the added tests.

All tests pass:

go test ./...
?       golift.io/starr/debuglog        [no test files]
ok      golift.io/starr (cached)
ok      golift.io/starr/lidarr  (cached)
ok      golift.io/starr/prowlarr        (cached)
ok      golift.io/starr/radarr  (cached)
ok      golift.io/starr/readarr (cached)
?       golift.io/starr/starrtest       [no test files]
ok      golift.io/starr/sonarr  (cached)
ok      golift.io/starr/starrcmd        (cached)

And specific tests output:

=== RUN   TestGetEpisodeByID
=== PAUSE TestGetEpisodeByID
=== CONT  TestGetEpisodeByID
=== RUN   TestGetEpisodeByID/200
=== PAUSE TestGetEpisodeByID/200
=== RUN   TestGetEpisodeByID/404
=== PAUSE TestGetEpisodeByID/404
=== CONT  TestGetEpisodeByID/200
=== CONT  TestGetEpisodeByID/404
--- PASS: TestGetEpisodeByID (0.00s)
    --- PASS: TestGetEpisodeByID/404 (0.00s)
    --- PASS: TestGetEpisodeByID/200 (0.00s)

Let me know if this works! Thanks.

davidnewhall commented 1 year ago

quick quick, thank you for your contribution!