* added {ny} convenience binding as a shorthand for {n} ({y})

This commit is contained in:
Reinhard Pointner 2015-11-05 05:14:07 +00:00
parent d6db7189db
commit a97ecb2a29
1 changed files with 7 additions and 0 deletions

View File

@ -109,6 +109,13 @@ public class MediaBindingBean {
return null;
}
@Define("ny")
public String getNameWithYear() {
String n = getName().toString();
String y = " (" + getYear().toString() + ")";
return n.endsWith(y) ? n : n + y; // account for TV Shows that contain the year in the series name, e.g. Doctor Who (2005)
}
@Define("s")
public Integer getSeasonNumber() {
return getEpisode().getSeason();