Skip to content

Instantly share code, notes, and snippets.

@jwmoss
Created October 29, 2022 18:48
Show Gist options
  • Save jwmoss/f801968d84ac820f8f3e4cb8adfd3f30 to your computer and use it in GitHub Desktop.
Save jwmoss/f801968d84ac820f8f3e4cb8adfd3f30 to your computer and use it in GitHub Desktop.
tautulli
function Get-LibraryTable {
[CmdletBinding()]
param (
[String[]]
$LibraryName = "Movies"
)
$body = @{
cmd = "get_libraries_table"
}
$res_data = Invoke-RestMethod -Uri "http://192.168.1.254:8181/api/v2?apikey=$apikey" -Body $body
$res_data.response.data.data | Where-Object {
$psitem.section_name -in $LibraryName
}
}
function Get-LibraryMediaInfo {
[CmdletBinding()]
param (
[String]
$SectionID = "3"
)
$body = @{
cmd = "get_library_media_info"
section_id = $SectionID
length = 10000
}
$res_data = Invoke-RestMethod -Uri "http://192.168.1.254:8181/api/v2?apikey=$apikey" -Body $body
$res_data.response.data.data
}
## store all of the movie media info in $movie_media_info
$movie_media_info = Get-LibraryMediaInfo
## Should return output
$movie_media_info.play_count | where-object {$_ -eq 0}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment