* update plex notify url

This commit is contained in:
Reinhard Pointner 2012-12-12 19:23:59 +00:00
parent b81845e277
commit 7b8430ab65
1 changed files with 2 additions and 12 deletions

View File

@ -22,19 +22,9 @@ def invokeScanVideoLibrary(host, port = 9090) {
/** /**
* Plex helpers * Plex helpers
*/ */
def refreshPlexLibrary(server, port = 32400, files = null) { def refreshPlexLibrary(server, port = 32400) {
_guarded { _guarded {
def sections = new URL("http://$server:$port/library/sections/").getXml() new URL("http://$server:$port/library/sections/all/refresh").get()
def locations = sections.Directory.Location.collect{ [path:it.'@path', key:it.parent().'@key'] }
// limit refresh locations
if (files != null) {
locations = locations.findAll{ loc -> files.find{ it.path; it.path.startsWith(loc.path) }}
}
locations*.key.unique().each{ key ->
new URL("http://$server:$port/library/sections/$key/refresh/").get()
}
} }
} }