Skip to content

Commit

Permalink
fixxing breaks and returns in search functions
Browse files Browse the repository at this point in the history
  • Loading branch information
fscorrupt committed Apr 11, 2024
1 parent 5fe842f commit ae5352b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
30 changes: 19 additions & 11 deletions Posterizarr.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ param (
[string]$mediatype
)

$CurrentScriptVersion = "1.2.1"
$CurrentScriptVersion = "1.2.2"
$global:HeaderWritten = $false
$ProgressPreference = 'SilentlyContinue'

Expand Down Expand Up @@ -983,13 +983,15 @@ function GetFanartMoviePoster {
Write-Entry -Subtext "Found Poster with text on FANART, skipping because you only want textless..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info
$global:FANARTAssetChangeUrl = "https://fanart.tv/movie/$id"
}
return $global:posterurl
continue
}
Else {
$global:posterurl = ($entrytemp.movieposter | Where-Object lang -eq '00')[0].url
Write-Entry -Subtext "Found Textless Poster on Fanart.tv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info
$global:TextlessPoster = $true
$global:FANARTAssetChangeUrl = "https://fanart.tv/movie/$id"
return $global:posterurl
break
}
}
Expand Down Expand Up @@ -1025,6 +1027,7 @@ function GetFanartMoviePoster {
$global:PosterWithText = $true
$global:FANARTAssetTextLang = $lang
}
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1062,13 +1065,15 @@ function GetFanartMovieBackground {
$global:Fallback = "TMDB"
$global:fanartfallbackposterurl = ($entrytemp.moviebackground)[0].url
}
return $global:posterurl
continue
}
Else {
$global:posterurl = ($entrytemp.moviebackground | Where-Object lang -eq '')[0].url
Write-Entry -Subtext "Found Textless background on Fanart.tv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info
$global:TextlessPoster = $true
$global:FANARTAssetChangeUrl = "https://fanart.tv/movie/$id"
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1110,13 +1115,15 @@ function GetFanartShowPoster {
Write-Entry -Subtext "Found Poster with text on FANART, skipping because you only want textless..." -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Yellow -log Info
$global:FANARTAssetChangeUrl = "https://fanart.tv/series/$id"
}
return $global:posterurl
continue
}
Else {
$global:posterurl = ($entrytemp.tvposter | Where-Object lang -eq '00')[0].url
Write-Entry -Subtext "Found Textless Poster on Fanart.tv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info
$global:TextlessPoster = $true
$global:FANARTAssetChangeUrl = "https://fanart.tv/series/$id"
return $global:posterurl
break
}
}
Expand Down Expand Up @@ -1152,6 +1159,7 @@ function GetFanartShowPoster {
$global:PosterWithText = $true
$global:FANARTAssetTextLang = $lang
}
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1189,13 +1197,15 @@ function GetFanartShowBackground {
$global:Fallback = "TMDB"
$global:fanartfallbackposterurl = ($entrytemp.showbackground)[0].url
}
return $global:posterurl
continue
}
Else {
$global:posterurl = ($entrytemp.showbackground | Where-Object lang -eq '')[0].url
Write-Entry -Subtext "Found Textless background on Fanart.tv" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Green -log Info
$global:TextlessPoster = $true
$global:FANARTAssetChangeUrl = "https://fanart.tv/series/$id"
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1246,7 +1256,7 @@ function GetFanartSeasonPoster {
Write-Entry -Subtext "PosterWithText: $global:PosterWithText" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "FANARTAssetTextLang: $global:FANARTAssetTextLang" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
Write-Entry -Subtext "FANARTAssetChangeUrl: $global:FANARTAssetChangeUrl" -Path $global:ScriptRoot\Logs\Scriptlog.log -Color Cyan -log Debug
continue
return $global:posterurl
}
}
}
Expand Down Expand Up @@ -1284,16 +1294,14 @@ function GetFanartSeasonPoster {
$global:FANARTAssetChangeUrl = "https://fanart.tv/series/$id"
$global:posterurl = $null
}
continue
return $global:posterurl
}
}
}
}
continue
}
Else {
$global:posterurl = $null
continue
}
}
if ($global:posterurl) {
Expand Down Expand Up @@ -1324,14 +1332,14 @@ function GetFanartSeasonPoster {
$global:PosterWithText = $true
$global:FANARTAssetTextLang = $lang
$global:FANARTAssetChangeUrl = "https://fanart.tv/series/$id"
continue
return $global:posterurl
}
}
}
}
Else {
$global:posterurl = $null
continue
return $global:posterurl
}
}
if ($global:posterurl) {
Expand Down Expand Up @@ -1385,8 +1393,8 @@ function GetTVDBMoviePoster {
$global:PosterWithText = $true
$global:TVDBAssetTextLang = $lang
}
return $global:posterurl
$global:TVDBAssetChangeUrl = "https://thetvdb.com/movies/$($response.data.slug)#artwork"
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1438,8 +1446,8 @@ function GetTVDBMoviePoster {
$global:PosterWithText = $true
$global:TVDBAssetTextLang = $lang
}
return $global:posterurl
$global:TVDBAssetChangeUrl = "https://thetvdb.com/movies/$($response.data.slug)#artwork"
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1516,8 +1524,8 @@ function GetTVDBMovieBackground {
$global:PosterWithText = $true
$global:TVDBAssetTextLang = $lang
}
return $global:posterurl
$global:TVDBAssetChangeUrl = "https://thetvdb.com/movies/$($response.data.slug)#artwork"
return $global:posterurl
continue
}
}
Expand Down Expand Up @@ -1613,8 +1621,8 @@ function GetTVDBShowPoster {
$global:PosterWithText = $true
$global:TVDBAssetTextLang = $lang
}
return $global:posterurl
$global:TVDBAssetChangeUrl = "https://thetvdb.com/series/$($response.data.slug)#artwork"
return $global:posterurl
continue
}
}
Expand Down
2 changes: 1 addition & 1 deletion Release.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.1
1.2.2

0 comments on commit ae5352b

Please sign in to comment.