Improved single/multi episode title default format {t}

This commit is contained in:
Reinhard Pointner 2016-08-23 12:58:27 +08:00
parent bdc81b3501
commit aab1c33859
1 changed files with 10 additions and 2 deletions

View File

@ -63,6 +63,7 @@ import net.filebot.web.EpisodeFormat;
import net.filebot.web.EpisodeListProvider; import net.filebot.web.EpisodeListProvider;
import net.filebot.web.Movie; import net.filebot.web.Movie;
import net.filebot.web.MoviePart; import net.filebot.web.MoviePart;
import net.filebot.web.MultiEpisode;
import net.filebot.web.SeriesInfo; import net.filebot.web.SeriesInfo;
import net.filebot.web.SimpleDate; import net.filebot.web.SimpleDate;
import net.filebot.web.SortOrder; import net.filebot.web.SortOrder;
@ -177,8 +178,15 @@ public class MediaBindingBean {
return getMusic().getTrackTitle() != null ? getMusic().getTrackTitle() : getMusic().getTitle(); return getMusic().getTrackTitle() != null ? getMusic().getTrackTitle() : getMusic().getTitle();
} }
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 // enforce title length limit by default
return truncateText(EpisodeFormat.SeasonEpisode.formatMultiTitle(getEpisodes()), NamingStandard.TITLE_MAX_LENGTH); return truncateText(t, NamingStandard.TITLE_MAX_LENGTH);
}
return null;
} }
@Define("d") @Define("d")