* better logging
This commit is contained in:
parent
ec5c492274
commit
5d35c903ca
@ -134,12 +134,12 @@ public class OpenSubtitlesXmlRpc {
|
|||||||
try {
|
try {
|
||||||
String imdbid = movie.get("id");
|
String imdbid = movie.get("id");
|
||||||
if (!imdbid.matches("\\d{1,7}"))
|
if (!imdbid.matches("\\d{1,7}"))
|
||||||
throw new IllegalArgumentException("Illegal IMDb movie ID");
|
throw new IllegalArgumentException("Illegal IMDb movie ID: Must be a 7-digit number");
|
||||||
|
|
||||||
// match movie name and movie year from search result
|
// match movie name and movie year from search result
|
||||||
Matcher matcher = pattern.matcher(movie.get("title"));
|
Matcher matcher = pattern.matcher(movie.get("title"));
|
||||||
if (!matcher.find())
|
if (!matcher.find())
|
||||||
throw new IllegalArgumentException("Illegal title");
|
throw new IllegalArgumentException("Illegal title: Must be in 'name (year)' format");
|
||||||
|
|
||||||
String name = matcher.group(1).replaceAll("\"", "").trim();
|
String name = matcher.group(1).replaceAll("\"", "").trim();
|
||||||
int year = Integer.parseInt(matcher.group(2));
|
int year = Integer.parseInt(matcher.group(2));
|
||||||
|
Loading…
Reference in New Issue
Block a user