1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-12-24 08:48:51 -05:00

* update plex notify url

This commit is contained in:
Reinhard Pointner 2012-12-12 19:23:59 +00:00
parent b81845e277
commit 7b8430ab65

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()
}
} }
} }