From 5bf2dc1a0fecb615e41769cfb04c0c4da5ea5307 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Mon, 29 Oct 2012 09:56:17 +0000 Subject: [PATCH] * don't crash if ut_title is not set but figure out some other useful email title --- website/scripts/utorrent-postprocess.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/website/scripts/utorrent-postprocess.groovy b/website/scripts/utorrent-postprocess.groovy index a71ca637..9457c380 100644 --- a/website/scripts/utorrent-postprocess.groovy +++ b/website/scripts/utorrent-postprocess.groovy @@ -188,13 +188,14 @@ if (gmail && !getRenameLog().isEmpty()) { // send html mail def renameLog = getRenameLog() + def emailTitle = tryQuietly { ut_title } ?: input*.dir.unique() sendGmail( - subject: '[FileBot] ' + ut_title, + subject: "[FileBot] ${emailTitle}", message: XML { html { body { - p("FileBot finished processing ${ut_title} (${renameLog.size()} files)."); + p("FileBot finished processing ${emailTitle} (${renameLog.size()} files)."); hr(); table { th("Parameter"); th("Value") _args.bindings.findAll{ param -> param.key =~ /^ut_/ }.each{ param ->