mirror of
https://github.com/SpotX-Official/SpotX.git
synced 2026-10-08 11:39:01 +11:00
fix: support variable-length hashes in spotify versions
This commit is contained in:
@@ -34,7 +34,7 @@ jobs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
$spotifyVersion = [string]$latestEntry.Value.fullversion
|
$spotifyVersion = [string]$latestEntry.Value.fullversion
|
||||||
if ([string]::IsNullOrWhiteSpace($spotifyVersion) -or $spotifyVersion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]{8}$') {
|
if ([string]::IsNullOrWhiteSpace($spotifyVersion) -or $spotifyVersion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]+$') {
|
||||||
throw "Invalid Spotify fullversion for $($latestEntry.Name)"
|
throw "Invalid Spotify fullversion for $($latestEntry.Name)"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -93,7 +93,7 @@ jobs:
|
|||||||
if (-not $installer.url -or $installer.size -le 0) {
|
if (-not $installer.url -or $installer.size -le 0) {
|
||||||
throw "No ARM64 installer found for Spotify $checkVersion"
|
throw "No ARM64 installer found for Spotify $checkVersion"
|
||||||
}
|
}
|
||||||
if ($entry.Value.fullversion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]{8}$') {
|
if ($entry.Value.fullversion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]+$') {
|
||||||
throw "Invalid Spotify fullversion for $checkVersion"
|
throw "Invalid Spotify fullversion for $checkVersion"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ function Get-SpotifyVersionNumber {
|
|||||||
[string]$SpotifyVersion
|
[string]$SpotifyVersion
|
||||||
)
|
)
|
||||||
|
|
||||||
return [Version]($SpotifyVersion -replace '\.g[0-9a-f]{8}$', '')
|
return [Version]($SpotifyVersion -replace '\.g[0-9a-f]+$', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
function Get-SpotifyInstallerArchitecture {
|
function Get-SpotifyInstallerArchitecture {
|
||||||
@@ -579,7 +579,7 @@ function Resolve-SpotifyInstallerVersionFromManifest {
|
|||||||
|
|
||||||
$entry = $selectedVersion.Value
|
$entry = $selectedVersion.Value
|
||||||
$fullVersion = [string]$entry.fullversion
|
$fullVersion = [string]$entry.fullversion
|
||||||
if ($fullVersion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]{8}$') {
|
if ($fullVersion -notmatch '^\d+\.\d+\.\d+\.\d+\.g[0-9a-f]+$') {
|
||||||
throw "Spotify version $($selectedVersion.Name) has invalid fullversion in versions manifest"
|
throw "Spotify version $($selectedVersion.Name) has invalid fullversion in versions manifest"
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -621,7 +621,7 @@ $spotifyTemporaryDownloadVersion = "1.2.86.502.g8cd7fb22"
|
|||||||
$spotifyVersionsManifestUrl = Get-Link -e "/table/versions.json" -Owner "LoaderSpot" -Repository "table"
|
$spotifyVersionsManifestUrl = Get-Link -e "/table/versions.json" -Owner "LoaderSpot" -Repository "table"
|
||||||
$systemArchitecture = Get-SystemArchitecture
|
$systemArchitecture = Get-SystemArchitecture
|
||||||
|
|
||||||
$match_v = "^(?<version>\d+\.\d+\.\d+(?:\.\d+(?:\.g[0-9a-f]{8})?)?)(?:-\d+)?$"
|
$match_v = "^(?<version>\d+\.\d+\.\d+(?:\.\d+(?:\.g[0-9a-f]+)?)?)(?:-\d+)?$"
|
||||||
$versionIsSupported = $false
|
$versionIsSupported = $false
|
||||||
if ($version) {
|
if ($version) {
|
||||||
if ($version -match $match_v) {
|
if ($version -match $match_v) {
|
||||||
|
|||||||
Reference in New Issue
Block a user