1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Default to {n} if {y} is undefined

This commit is contained in:
Reinhard Pointner 2018-07-22 08:53:11 +07:00
parent 26be12bda8
commit a615b362db

View File

@ -135,11 +135,16 @@ public class MediaBindingBean {
@Define("ny")
public String getNameWithYear() {
String n = getName().toString();
String y = " (" + getYear().toString() + ")";
String n = getName();
try {
String y = String.format(" (%d)", getYear());
// account for TV Shows that contain the year in the series name, e.g. Doctor Who (2005)
return n.endsWith(y) ? n : n + y;
// account for TV Shows that contain the year in the series name, e.g. Doctor Who (2005)
return n.endsWith(y) ? n : n + y;
} catch (Exception e) {
// default to {n} if {y} is undefined
}
return n;
}
@Define("s")