From 47f7ea45a2fcf921843aec23a8c14674e40962c7 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Sun, 2 Apr 2017 15:56:19 +0800 Subject: [PATCH] Refactor NamingStandard --- source/net/filebot/media/NamingStandard.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/source/net/filebot/media/NamingStandard.java b/source/net/filebot/media/NamingStandard.java index 6cf3f958..058de828 100644 --- a/source/net/filebot/media/NamingStandard.java +++ b/source/net/filebot/media/NamingStandard.java @@ -72,12 +72,15 @@ public enum NamingStandard { private static String path(String... name) { return stream(name).filter(Objects::nonNull).map(s -> { - s = replaceColon(s, ".", " - "); - s = replacePathSeparators(s, " "); - s = normalizeQuotationMarks(s); - s = trimTrailingPunctuation(s); - s = validateFileName(s); - return s; + return replaceColon(s, ".", " - "); + }).map(s -> { + return replacePathSeparators(s, " "); + }).map(s -> { + return normalizeQuotationMarks(s); + }).map(s -> { + return trimTrailingPunctuation(s); + }).map(s -> { + return validateFileName(s); }).filter(s -> s.length() > 0).collect(joining("/")); }