From aab1c338591959f84571832f399e43c00c982c31 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Tue, 23 Aug 2016 12:58:27 +0800 Subject: [PATCH] Improved single/multi episode title default format {t} --- source/net/filebot/format/MediaBindingBean.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/net/filebot/format/MediaBindingBean.java b/source/net/filebot/format/MediaBindingBean.java index 62f968b2..11140960 100644 --- a/source/net/filebot/format/MediaBindingBean.java +++ b/source/net/filebot/format/MediaBindingBean.java @@ -63,6 +63,7 @@ import net.filebot.web.EpisodeFormat; import net.filebot.web.EpisodeListProvider; import net.filebot.web.Movie; import net.filebot.web.MoviePart; +import net.filebot.web.MultiEpisode; import net.filebot.web.SeriesInfo; import net.filebot.web.SimpleDate; import net.filebot.web.SortOrder; @@ -177,8 +178,15 @@ public class MediaBindingBean { return getMusic().getTrackTitle() != null ? getMusic().getTrackTitle() : getMusic().getTitle(); } - // enforce title length limit by default - return truncateText(EpisodeFormat.SeasonEpisode.formatMultiTitle(getEpisodes()), NamingStandard.TITLE_MAX_LENGTH); + if (infoObject instanceof Episode) { + // support multi-episode title formatting + String t = infoObject instanceof MultiEpisode ? EpisodeFormat.SeasonEpisode.formatMultiTitle(getEpisodes()) : getEpisode().getTitle(); + + // enforce title length limit by default + return truncateText(t, NamingStandard.TITLE_MAX_LENGTH); + } + + return null; } @Define("d")