improvements

This commit is contained in:
secretspecter 2023-06-28 12:27:21 -06:00
parent 63f69fe22a
commit 3bc3b43d3a
3 changed files with 12 additions and 5 deletions

View file

@ -10,13 +10,17 @@ if (-not (Get-Command "magick" -ErrorAction SilentlyContinue)) {
exit exit
} }
if ($in -notmatch '\\$') {
$in += "\"
}
if (Test-Path $in -PathType container) { if (Test-Path $in -PathType container) {
$out_dir = "$out\x$scale\" $out_dir = "$out\$(Split-Path -Leaf $in)_x$scale\"
if (-not (Test-Path $out_dir)) { if (-not (Test-Path $out_dir)) {
New-Item "$out_dir" -ItemType directory New-Item "$out_dir" -ItemType directory
} }
foreach ($image in Get-ChildItem "$in*" -Include *.png, *.jpg, *.gif) { foreach ($image in Get-ChildItem "$in*" -Include *.png, *.jpg, *.gif) {
$scaled = "$out_dir$($image.BaseName)$($image.Extension)" $scaled = "$out_dir$($image.BaseName)_x$scale$($image.Extension)"
Write-Host $scaled Write-Host $scaled
magick $image.FullName -scale "$($scale * 100)%" $scaled magick $image.FullName -scale "$($scale * 100)%" $scaled
} }

View file

@ -13,10 +13,11 @@ if ($url) {
} }
$streamlink_opts = "--default-stream $quality" $streamlink_opts = "--default-stream $quality"
$streamlink_opts = " --retry-streams $retryinterval" $streamlink_opts += " --retry-streams $retryinterval"
if ($out -and -not $norecord) { if ($record -and -not $norecord) {
$streamlink_opts = " --record $out" $streamlink_opts += " --record $record"
} }
Write-Host "streamlink $streamlink_opts $url"
Start-Process streamlink -ArgumentList "$streamlink_opts $url" Start-Process streamlink -ArgumentList "$streamlink_opts $url"
} }

View file

@ -3,6 +3,8 @@ param(
[switch]$CleanOnly [switch]$CleanOnly
) )
winget upgrade --all
if ((Get-Command "scoop" -ErrorAction SilentlyContinue) -and -not $elevated) { if ((Get-Command "scoop" -ErrorAction SilentlyContinue) -and -not $elevated) {
if (-not $CleanOnly) { if (-not $CleanOnly) {
scoop update scoop update