Fix issue with movieCompare

master
Omertron 14 years ago
parent 2867e14bc4
commit 7c6238d749

@ -80,6 +80,7 @@ public class TheMovieDb {
/** /**
* Get the API key that is to be used * Get the API key that is to be used
*
* @return * @return
*/ */
public String getApiKey() { public String getApiKey() {
@ -466,6 +467,7 @@ public class TheMovieDb {
/** /**
* This method is used to retrieve the newest movie that was added to TMDb. * This method is used to retrieve the newest movie that was added to TMDb.
*
* @return * @return
*/ */
public MovieDb getLatestMovie() { public MovieDb getLatestMovie() {
@ -491,8 +493,7 @@ public class TheMovieDb {
return false; return false;
} }
if (StringUtils.isNotBlank(year)) { if (StringUtils.isNotBlank(year) && !year.equalsIgnoreCase("UNKNOWN") && StringUtils.isNotBlank(moviedb.getReleaseDate())) {
if (StringUtils.isNotBlank(moviedb.getReleaseDate())) {
// Compare with year // Compare with year
String movieYear = moviedb.getReleaseDate().substring(0, 4); String movieYear = moviedb.getReleaseDate().substring(0, 4);
if (movieYear.equals(year)) { if (movieYear.equals(year)) {
@ -505,7 +506,7 @@ public class TheMovieDb {
} }
} }
} }
} else {
// Compare without year // Compare without year
if (moviedb.getOriginalTitle().equalsIgnoreCase(title)) { if (moviedb.getOriginalTitle().equalsIgnoreCase(title)) {
return true; return true;
@ -514,7 +515,7 @@ public class TheMovieDb {
if (moviedb.getTitle().equalsIgnoreCase(title)) { if (moviedb.getTitle().equalsIgnoreCase(title)) {
return true; return true;
} }
}
return false; return false;
} }
} }

Loading…
Cancel
Save