mirror of
https://github.com/mitb-archive/filebot
synced 2024-11-17 23:05:03 -05:00
* 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,19 +212,33 @@ if (getRenameLog().isEmpty()) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// make xbmc or plex scan for new content
|
// run program on newly processed files
|
||||||
xbmc?.each{ host ->
|
if (exec) {
|
||||||
|
getRenameLog().each{ from, to ->
|
||||||
|
def command = getMediaInfo(format: exec, file: to)
|
||||||
|
_log.finest("Execute: $command")
|
||||||
|
execute(command)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// make XMBC scan for new content and display notification message
|
||||||
|
if (xbmc) {
|
||||||
|
xbmc.each{ host ->
|
||||||
println "Notify XBMC: $host"
|
println "Notify XBMC: $host"
|
||||||
_guarded{
|
_guarded{
|
||||||
showNotification(host, 9090, 'FileBot', "Finished processing ${tryQuietly { ut_title } ?: input*.dir.name.unique()} (${getRenameLog().size()} files).", 'http://filebot.sourceforge.net/images/icon.png')
|
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)
|
scanVideoLibrary(host, 9090)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
plex?.each{
|
// make Plex scan for new content
|
||||||
|
if (plex) {
|
||||||
|
plex.each{
|
||||||
println "Notify Plex: $it"
|
println "Notify Plex: $it"
|
||||||
refreshPlexLibrary(it)
|
refreshPlexLibrary(it)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// mark episodes as 'acquired'
|
// mark episodes as 'acquired'
|
||||||
if (myepisodes) {
|
if (myepisodes) {
|
||||||
|
Loading…
Reference in New Issue
Block a user