From f6871a26c7c4fc3852420004dda0c828356bec1e Mon Sep 17 00:00:00 2001 From: Journey Date: Mon, 5 Feb 2024 19:20:24 -0600 Subject: [PATCH] Drop Version 3 support since it is no longer getting upgrades and just start getting Version 4 updates. also switch to using github for releases since it seems sonarr has finally started uploading their releases to github as well. --- automatic/sonarr/README.md | 5 +- automatic/sonarr/legal/VERIFICATION.txt | 4 +- automatic/sonarr/sonarr.json | 5 -- automatic/sonarr/update.ps1 | 66 +++++-------------------- 4 files changed, 16 insertions(+), 64 deletions(-) delete mode 100644 automatic/sonarr/sonarr.json diff --git a/automatic/sonarr/README.md b/automatic/sonarr/README.md index 98f69cb1..34fcfd99 100644 --- a/automatic/sonarr/README.md +++ b/automatic/sonarr/README.md @@ -18,12 +18,11 @@ Sonarr (formerly NzbDrone) is a PVR for Usenet and BitTorrent users. It can moni ## Community -- [IRC](https://webchat.freenode.net/?channels=#sonarr) +- [IRC](https://web.libera.chat/?channels=#sonarr) +- [Discord](https://discord.sonarr.tv) - [Twitter](https://twitter.com/sonarrtv) - [Reddit](https://www.reddit.com/r/sonarr) ## Notes -The long awaited moment has finally arrived. Starting (3/8/2021) Sonarr v2 is now officially EOL and unsupported. Sonarr v3 is officially out of beta and is the stable release. - Installs as a service, to get to Sonarr open browser and go to [localhost]:8989 (remove the brackets) diff --git a/automatic/sonarr/legal/VERIFICATION.txt b/automatic/sonarr/legal/VERIFICATION.txt index a9055f91..aa2b1ba4 100644 --- a/automatic/sonarr/legal/VERIFICATION.txt +++ b/automatic/sonarr/legal/VERIFICATION.txt @@ -4,12 +4,13 @@ Verification is intended to assist the Chocolatey moderators and community in verifying that this package's contents are trustworthy. The embedded software has been downloaded from the listed download -location on +location on and can be verified by doing the following: 1. Download the following: url: + url64: 2. You can obtain the checksum using one of the following methods: - Use powershell function 'Get-FileHash' @@ -17,6 +18,7 @@ and can be verified by doing the following: checksum type: sha256 checksum: 43B4E6CD3E96D51CCE5AE5A65FAE2E051773D23217D30AA276E1CFEBC56D8B5D + checksum64:43B4E6CD3E96D51CCE5AE5A65FAE2E051773D23217D30AA276E1CFEBC56D8B5D Using AU: diff --git a/automatic/sonarr/sonarr.json b/automatic/sonarr/sonarr.json deleted file mode 100644 index 57629edf..00000000 --- a/automatic/sonarr/sonarr.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "V3_Dev": "3.0.9.1555-beta", - "V3_Stable": "3.0.10.1567", - "V4_Dev": "4.0.0.752-v4beta" -} diff --git a/automatic/sonarr/update.ps1 b/automatic/sonarr/update.ps1 index 9bb52495..2e94bbe3 100644 --- a/automatic/sonarr/update.ps1 +++ b/automatic/sonarr/update.ps1 @@ -1,17 +1,18 @@ Import-Module au Import-Module "$PSScriptRoot\..\..\scripts\au_extensions.psm1" -$Releases = 'https://services.sonarr.tv/v1/download/main/latest?version=3&os=windows&installer=true' - $repoUser = "Sonarr" $repoName = "Sonarr" function global:au_SearchReplace { @{ ".\legal\VERIFICATION.txt" = @{ - "(?i)(^\s*url(32)?\:\s*).*" = "`${1}<$($Latest.URL32)>" - "(?i)(^\s*checksum(32)?\:\s*).*" = "`${1}$($Latest.Checksum32)" - "(?i)(^\s*checksum\s*type\:\s*).*" = "`${1}$($Latest.ChecksumType32)" + "(?i)(^\s*location on\:?\s*)\<.*\>" = "`${1}<$($Latest.ReleaseUri)>" + "(?i)(^\s*url(32)?\:\s*).*" = "`${1}<$($Latest.URL32)>" + "(?i)(^\s*url64?\:\s*).*" = "`${1}<$($Latest.URL64)>" + "(?i)(^\s*checksum(32)?\:\s*).*" = "`${1}$($Latest.Checksum32)" + "(?i)(^\s*checksum64?\:\s*).*" = "`${1}$($Latest.Checksum64)" + "(?i)(^\s*checksum\s*type\:\s*).*" = "`${1}$($Latest.ChecksumType32)" } } } @@ -32,59 +33,14 @@ function global:au_AfterUpdate($Package) { Invoke-VirusTotalScan $Package } -function GetV3StableVersion() { - $download_page = Get-RedirectedUrl $Releases - - $url = $download_page - $version = $url -split 'main/|/Sonarr' | Select-Object -Last 1 -Skip 1 - - @{ - PackageName = "sonarr" - Version = $version - URL32 = $url - } -} - -function GetV3DevVersion() { - $download_page = Get-RedirectedUrl $Releases.replace('main', 'develop') - - $url = $download_page - $version = $url -split 'develop/|/Sonarr' | Select-Object -Last 1 -Skip 1 - $build = "-beta" - - @{ - PackageName = "sonarr" - Version = ($version + $build) - URL32 = $url - } -} - -function GetV4DevVersion() { - $download_page = Get-RedirectedUrl $Releases.replace('main', 'develop').Replace('version=3', 'version=4') - - $url = $download_page - $version = $url -split 'develop/|/Sonarr' | Select-Object -Last 1 -Skip 1 - $build = "-v4beta" - - @{ - PackageName = "sonarr" - Version = ($version + $build) - URL32 = $url - } -} - function global:au_GetLatest { - $v3stableStream = GetV3StableVersion - $v3devStream = GetV3DevVersion - $v4devStream = GetV4DevVersion + $release = Get-LatestGithubReleases $repoUser $repoName $true - $streams = [ordered] @{ - V3_Stable = $v3stableStream - V3_Dev = $v3devStream - V4_Dev = $v4devStream - } + $url32 = $release.latest.Assets | Where-Object { $_ -match 'x86-installer\.exe$' } | Select-Object -First 1 + $url64 = $release.latest.Assets | Where-Object { $_ -match 'x64-installer\.exe$' } | Select-Object -First 1 - return @{ Streams = $streams } + $Latest = @{ URL32 = $url32; URL64 = $url64; Version = $release.latest.Version; ReleaseUri = $release.latest.ReleaseUrl } + return $Latest } update -ChecksumFor none