Giter Site home page Giter Site logo

sparky-de / poshsonarr Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yevrag35/poshsonarr

0.0 0.0 0.0 3.36 MB

A project aimed at creating a PowerShell module for querying and managing Sonarr PVR.

Home Page: https://www.powershellgallery.com/packages/PoshSonarr

License: GNU General Public License v3.0

C# 99.16% PowerShell 0.84%

poshsonarr's Introduction

PoshSonarr

version downloads

This will eventually be a complete PowerShell module for quickly issuing Sonarr PVR API calls. The module was completely redesigned from the ground up in PowerShell Core, and I'm happy to say it works (has been tested) in Ubuntu 16.04 and Ubuntu 18.04 as well as Windows.

CHANGELOG

1.3.0 (Release)

  • Includes all the changes from the prerelease versions.
  • Fixed these issues:
    • Issue#12 - Get-SonarrEpisode -SeriesId invalid parameter binding
    • Issue#13 - Get-SonarrCalendar -Today displays episode airing at midnight tomorrow

1.3.0-gamma

(3/18/2020)

  • Fix major bug with Connect-SonarrInstance that has existed since 'beta'. When -NoApiPrefix is not used, the TagManager object creation during connection no longer shows an error and tag management will work again.

1.3.0-delta

(3/16/2020)

  • Fixed mandatory parameter requirement for Get-SonarrCalendar. DayOfWeek is no longer required (as it should never have been...).
  • Get-SonarrTag no longer returns all tags when used in the pipeline.
  • Get-SonarrSize has been removed. (It was no longer needed)
  • NEW CMDLET:
    • Update-SonarrQualityProfile (Set-SonarrQualityProfile/Update-SonarrProfile/Set-SonarrProfile)

1.3.0-beta

(3/10/2020)

  • Dropping support for PowerShell 6 in favor of 7 - v1.3.0 will be the last version to include the binaries for running on PowerShell 6.x.x versions. To use the newer versions going forward, upgrade to PowerShell 7.

  • NEW CMDLETS:

    • Get-SonarrSize (Returns the total file size of a Series, Season, or EpisodeFile)
    • New-SonarrDelayProfile
    • New-SonarrPlexNotification (New-PlexConnection)
    • Restart-SonarrInstance (Restart-Sonarr)
    • Set-SonarrDelayProfile
    • Update-SonarrDownloadClient
  • TAGS (Better Tag Management)

    • DelayProfile, Notification (Connection), Restriction, and Series objects can have their tags queried, added to, changed, or removed now very easily with:
      • Add-SonarrTag
      • Get-SonarrTag
      • Remove-SonarrTag
    Get-SonarrSeries "brooklyn*" | Add-SonarrTag -Tag "my favorite"
    Get-SonarrSeries "*Agents of S*" | Remove-SonarrTag -ClearAll
  • Add-SonarrSeries now accepts a [SearchSeries] object from the pipeline, instead of properties by name. It also adds a parameter, -Type to denote the type of series ("Anime", "Daily", "Standard").

  • Added -Today and -Tomorrow switch parameters to Get-SonarrCalendar.

  • Series, Episode, and EpisodeFile ID's are now treated as [int] value types.

  • Get-SonarrEpisode has new switches for filtering results: -Downloaded and -HasAired.

  • Get-SonarrEpisodeFile is now piped from an [EpisodeResult] instead of by property name.

  • Get-SonarrLog has added lots of new parameters for custom filtering log entries.

  • Changed Get-SonarrQualityProfile's -Id parameter to be -ProfileId to allow for ValueFromPipelineByPropertyName to work properly.

  • Changed Remove-SonarrSeries to accept a [SeriesResult] from the pipeline as opposed to using values from properties.

  • Search-SonarrDirectory has a new switch parameter: -ExcludeFiles. This tells the query to only return directories.

  • PowerShell format file changes.

1.3.0-alpha

(1/13/2020)

Version 1.3.0 will be a major update (even though it's a minor revision :P) as the entire backend for issuing the API calls was overhauled. The biggest deal was that now every command will have a WriteDebug part prior to issuing any API request. It also simplified the requesting process and did away the need for explicit type casting on the responses.

Another big error of improvement was the handling of exceptions that may occur on the server end. Before, exceptions may have been cryptic/vague rendering them utterly useless. Now, exceptions are either thrown directly, or the exception response(s) from the API request are directly translated to PowerShell ErrorRecord(s).

In addition to the backend changes, improvements were made to the cmdlets as well as introducing new cmdlets. There are a total of 18 new cmdlets in this release (see Cmdlets section for the complete list).

Using

To get started, connect to Sonarr with "Connect-SonarrInstance" (Connect-Sonarr) cmdlet:

# By Server and Port -- (8989 is the default port)
Connect-Sonarr -Server "MEDIASERVER" -ApiKey "xxxxxxxxxxxxxxxx" -PassThru

   Version Authentication Url                        StartupPath
   ------- -------------- ---                        -----------
2.0.0.5322      forms      http://MEDIASERVER:8989/   C:\ProgramData\NzbDrone\bin

# By explicit URL
Connect-Sonarr -Url "https://sonarr-api.cloud.com" -ApiKey "xxxxxxxxxxxx" -PassThru

# If you have a reverse proxy that strips away the "/api" path, use the "-NoApiPrefix" switch.

# If you have a reverse proxy URL base set, include that in the -SonarrUrl parameter or use the new "-ReverseProxyUrlBase" parameter when combined with a HostName.

Connect-Sonarr -Url "http://sonarr:8989/sonarr" ...
# or
Connect-Sonarr -HostName "mediaserver" -ReverseProxyUrlBase "sonarr" ...

See the wiki for more information about reverse proxy situations.

An example of some commands in action:

# Set Season 3 of a series to 'Not Monitored'
$series = Get-SonarrSeries -Name 24
$series.Seasons[2].Monitored = $false
$series | Update-SonarrSeries

# Search for a particular series and add it to Sonarr
Search-SonarrSeries "The X-Files" | Add-SonarrSeries -RootFolderPath "\\NAS\Shows" -IgnoreEpisodesWithFiles -SearchForMissingEpisodes -UseSeasonFolders

Cmdlets

As of 3/20/2020, I'm still missing the following commands:

  1. DownloadedEpisodesScan
  2. MissingEpisodeSearch
  3. RenameFiles
  4. RenameSeries

The following is the list of the working cmdlets:

  • Commands in bold are new in v1.3.0
  • Aliases and notes are italicized
  1. Add-SonarrRelease
  2. Add-SonarrSeries
  3. Add-SonarrTag
  4. Clear-SonarrLog
  5. Connect-SonarrInstance - (Connect-Sonarr)
  6. Get-SonarrBackup
  7. Get-SonarrCalendar
  8. Get-SonarrCommand - (Get-SonarrJob)
  9. Get-SonarrDelayProfile
  10. Get-SonarrDiskspace
  11. Get-SonarrDownloadClient
  12. Get-SonarrEpisode
  13. Get-SonarrEpisodeFile
  14. Get-SonarrHistory
  15. Get-SonarrHostConfig
  16. Get-SonarrLog
  17. Get-SonarrLogFile
  18. Get-SonarrMapping
  19. Get-SonarrMediaManagement
  20. Get-SonarrMetadata
  21. Get-SonarrNotification - (Get-SonarrConnection)
  22. Get-SonarrQualityProfile - (Get-SonarrProfile)
  23. Get-SonarrQueue
  24. Get-SonarrRelease - * renamed to Search-SonarrRelease (left behind as alias...)
  25. Get-SonarrRestriction
  26. Get-SonarrRootFolder
  27. Get-SonarrSeries
  28. Get-SonarrStatus
  29. Get-SonarrTag
  30. Get-SonarrUpdate
  31. Get-SonarrWantedMissing
  32. Invoke-SonarrBackup - (Backup-Sonarr)
  33. Invoke-SonarrEpisodeSearch
  34. Invoke-SonarrRssSync
  35. Invoke-SonarrSeasonSearch
  36. Invoke-SonarrSeriesRefresh
  37. Invoke-SonarrSeriesRescan
  38. Invoke-SonarrSeriesSearch
  39. New-SonarrDelayProfile
  40. New-SonarrMapping
  41. New-SonarrPlexNotification - (New-PlexNotification)
  42. New-SonarrQualityProfile - (New-SonarrProfile)
  43. New-SonarrReleasePush
  44. New-SonarrRestriction
  45. New-SonarrTag
  46. Register-SonarrRootFolder (New-SonarrRootFolder)
  47. Remove-SonarrEpisodeFile
  48. Remove-SonarrMapping
  49. Remove-SonarrQualityProfile - (Remove-SonarrProfile)
  50. Remove-SonarrQueueItem
  51. Remove-SonarrRestriction
  52. Remove-SonarrRootFolder
  53. Remove-SonarrSeries
  54. Remove-SonarrTag
  55. Rename-SonarrTag - * (was Set-SonarrTag)
  56. Restart-SonarrInstance - (Restart-Sonarr)
  57. Save-SonarrLogFile
  58. Search-SonarrDirectory
  59. Search-SonarrRelease
  60. Search-SonarrSeries
  61. Set-SonarrDelayProfile
  62. Set-SonarrEpisode
  63. Set-SonarrHostConfig
  64. Set-SonarrMapping
  65. Set-SonarrRestriction
  66. Set-SonarrSeries - * (was Update-SonarrSeries)
  67. Set-SonarrTag - * (renamed to Rename-SonarrTag; left behind as alias)
  68. Update-SonarrDownloadClient
  69. Update-SonarrMediaManagement
  70. Update-SonarrMetadata
  71. Update-SonarrQualityProfile (Set-SonarrQualityProfile/Update-SonarrProfile/Set-SonarrProfile)
  72. Update-SonarrRestriction
  73. Update-SonarrSeries - * (renamed to Set-SonarrSeries; left behind as alias)

poshsonarr's People

Contributors

yevrag35 avatar

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.