* support --def exec=command to allow user-defined postprocessing
This commit is contained in:
parent
e73dcc9691
commit
015f997ba2
|
@ -18,6 +18,7 @@ def subtitles = tryQuietly{ subtitles.toBoolean() ? ['en'] : subtitles.split(/[
|
||||||
def artwork = tryQuietly{ artwork.toBoolean() }
|
def artwork = tryQuietly{ artwork.toBoolean() }
|
||||||
def backdrops = tryQuietly{ backdrops.toBoolean() }
|
def backdrops = tryQuietly{ backdrops.toBoolean() }
|
||||||
def clean = tryQuietly{ clean.toBoolean() }
|
def clean = tryQuietly{ clean.toBoolean() }
|
||||||
|
def exec = tryQuietly{ exec.toString() }
|
||||||
|
|
||||||
// array of xbmc/plex hosts
|
// array of xbmc/plex hosts
|
||||||
def xbmc = tryQuietly{ xbmc.split(/[ ,|]+/) }
|
def xbmc = tryQuietly{ xbmc.split(/[ ,|]+/) }
|
||||||
|
@ -26,7 +27,7 @@ def plex = tryQuietly{ plex.split(/[ ,|]+/) }
|
||||||
// myepisodes updates and email notifications
|
// myepisodes updates and email notifications
|
||||||
def myepisodes = tryQuietly { myepisodes.split(':', 2) }
|
def myepisodes = tryQuietly { myepisodes.split(':', 2) }
|
||||||
def gmail = tryQuietly{ gmail.split(':', 2) }
|
def gmail = tryQuietly{ gmail.split(':', 2) }
|
||||||
def pushover = tryQuietly{ pushover }
|
def pushover = tryQuietly{ pushover.toString() }
|
||||||
|
|
||||||
|
|
||||||
// series/anime/movie format expressions
|
// series/anime/movie format expressions
|
||||||
|
@ -211,18 +212,32 @@ if (getRenameLog().isEmpty()) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// make xbmc or plex scan for new content
|
// run program on newly processed files
|
||||||
xbmc?.each{ host ->
|
if (exec) {
|
||||||
println "Notify XBMC: $host"
|
getRenameLog().each{ from, to ->
|
||||||
_guarded{
|
def command = getMediaInfo(format: exec, file: to)
|
||||||
showNotification(host, 9090, 'FileBot', "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).", 'http://filebot.sourceforge.net/images/icon.png')
|
_log.finest("Execute: $command")
|
||||||
scanVideoLibrary(host, 9090)
|
execute(command)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
plex?.each{
|
// make XMBC scan for new content and display notification message
|
||||||
println "Notify Plex: $it"
|
if (xbmc) {
|
||||||
refreshPlexLibrary(it)
|
xbmc.each{ host ->
|
||||||
|
println "Notify XBMC: $host"
|
||||||
|
_guarded{
|
||||||
|
showNotification(host, 9090, 'FileBot', "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).", 'http://filebot.sourceforge.net/images/icon.png')
|
||||||
|
scanVideoLibrary(host, 9090)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// make Plex scan for new content
|
||||||
|
if (plex) {
|
||||||
|
plex.each{
|
||||||
|
println "Notify Plex: $it"
|
||||||
|
refreshPlexLibrary(it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// mark episodes as 'acquired'
|
// mark episodes as 'acquired'
|
||||||
|
|
Loading…
Reference in New Issue