Created
May 21, 2017 11:04
-
-
Save Sam-Martin/ed62cf76031027043790e8a60830a0ee to your computer and use it in GitHub Desktop.
Update Radarr Qualities from HDTV to BluRay
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Uri = "http://192.168.1.1:7878/api/" | |
$headers = @{ | |
'x-api-key' = "" | |
} | |
$Movies = Invoke-RestMethod -Uri "$Uri/movie" -Headers $headers -Method Get | |
$KnownQualities = $Movies.MovieFile.quality.quality | select -Unique id,name | |
foreach($Movie in $Movies | ?{$_.MovieFile.quality.quality.name -like "*HDTV*"}){ | |
$QualityWithoutSource = $Movie.MovieFile.quality.quality.name -replace 'HDTV-','' | |
$BluRayQuality = $KnownQualities | ?{$_.Name -like "BluRay-$QualityWithoutSource"} | |
$Movie.movieFile.quality.quality = $BluRayQuality | |
$Result = Invoke-RestMethod -Uri "$Uri/moviefile" -Headers $headers -Method Put -Body $($Movie.movieFile | ConvertTo-Json -Depth 99) | |
$Result.quality | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment