Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

Commit

Permalink
Drop Version 3 support since it is no longer getting upgrades and just
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
JourneyOver committed Feb 6, 2024
1 parent 92b76c9 commit f6871a2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 64 deletions.
5 changes: 2 additions & 3 deletions automatic/sonarr/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
4 changes: 3 additions & 1 deletion automatic/sonarr/legal/VERIFICATION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,21 @@ 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 <https://sonarr.tv/>
location on <https://sonarr.tv>
and can be verified by doing the following:

1. Download the following:

url: <https://download.sonarr.tv/v4/develop/4.0.0.752/Sonarr.develop.4.0.0.752.win-x64-installer.exe>
url64: <https://download.sonarr.tv/v4/develop/4.0.0.752/Sonarr.develop.4.0.0.752.win-x64-installer.exe>

2. You can obtain the checksum using one of the following methods:
- Use powershell function 'Get-FileHash'
- Use Chocolatey utility 'checksum.exe'

checksum type: sha256
checksum: 43B4E6CD3E96D51CCE5AE5A65FAE2E051773D23217D30AA276E1CFEBC56D8B5D
checksum64:43B4E6CD3E96D51CCE5AE5A65FAE2E051773D23217D30AA276E1CFEBC56D8B5D

Using AU:

Expand Down
5 changes: 0 additions & 5 deletions automatic/sonarr/sonarr.json

This file was deleted.

66 changes: 11 additions & 55 deletions automatic/sonarr/update.ps1
Original file line number Diff line number Diff line change
@@ -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)"
}
}
}
Expand All @@ -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

0 comments on commit f6871a2

Please sign in to comment.