Skip to content

Commit 3f5768f

Browse files
committed
fix: Update fanart module check
1 parent 765a547 commit 3f5768f

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Posterizarr.ps1

+16-11
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ param (
1111
[switch]$SyncEmby
1212
)
1313

14-
$CurrentScriptVersion = "1.8.8"
14+
$CurrentScriptVersion = "1.8.9"
1515
$global:HeaderWritten = $false
1616
$ProgressPreference = 'SilentlyContinue'
1717

@@ -6257,16 +6257,21 @@ if (!$SyncJelly -and !$SyncEmby) {
62576257
Write-Entry -Message "Checking size of overlay files..." -Path $configLogging -Color White -log Info
62586258
CheckOverlayDimensions -Posteroverlay "$Posteroverlay" -Backgroundoverlay "$Backgroundoverlay" -Titlecardoverlay "$titlecardoverlay" -PosterSize "$PosterSize" -BackgroundSize "$BackgroundSize" -Seasonoverlay "$Seasonoverlay"
62596259

6260+
# Check if the FanartTvAPI module is installed
6261+
$module = Get-Module -ListAvailable -Name FanartTvAPI
62606262

6261-
# check if fanart Module is installed
6262-
if (!(Get-InstalledModule -Name FanartTvAPI)) {
6263-
Write-Entry -Message "FanartTvAPI Module missing, installing it for you..." -Path $configLogging -Color Red -log Error
6264-
Write-Entry -Subtext "[ERROR-HERE] See above. ^^^" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error
6265-
$errorCount++
6266-
Install-Module -Name FanartTvAPI -Force -Confirm -AllowClobber
6267-
6268-
Write-Entry -Subtext "FanartTvAPI Module installed, importing it now..." -Path $configLogging -Color Green -log Info
6269-
Import-Module -Name FanartTvAPI
6263+
if (-not $module) {
6264+
# Try to install the module
6265+
try {
6266+
Install-Module -Name $moduleName -Force -SkipPublisherCheck -AllowPrerelease -Scope AllUsers
6267+
Write-Entry -Message "FanartTvAPI Module missing, installing it for you..." -Path $configLogging -Color Red -log Error
6268+
Write-Entry -Subtext "[ERROR-HERE] See above. ^^^" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Red -log Error
6269+
$errorCount++
6270+
Write-Entry -Subtext "FanartTvAPI Module installed, importing it now..." -Path $configLogging -Color Green -log Info
6271+
Import-Module -Name FanartTvAPI
6272+
} catch {
6273+
Write-Host "Failed to install $moduleName module. Error: $_"
6274+
}
62706275
}
62716276
# Add Fanart API
62726277
Add-FanartTvAPIKey -Api_Key $FanartTvAPIKey
@@ -19159,4 +19164,4 @@ else {
1915919164
if (Test-Path $CurrentlyRunning) {
1916019165
Remove-Item -LiteralPath $CurrentlyRunning | out-null
1916119166
}
19162-
}
19167+
}

Release.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.8.8
1+
1.8.9

0 commit comments

Comments
 (0)