diff --git a/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java b/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java index 2a60da8e4..18efa4e5c 100644 --- a/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java +++ b/themoviedbapi/src/com/moviejukebox/themoviedb/model/MovieDB.java @@ -54,18 +54,6 @@ public class MovieDB extends ModelTools { private List people = new ArrayList(); private List artwork = new ArrayList(); - /** - * Just return the first country - * @return - */ - public String getCountry() { - if (!countries.isEmpty()) { - Country country = countries.get(0); - return country.getName(); - } - return UNKNOWN; - } - public String getPopularity() { return popularity; } diff --git a/themoviedbapi/src/com/moviejukebox/themoviedb/tools/DOMParser.java b/themoviedbapi/src/com/moviejukebox/themoviedb/tools/DOMParser.java index 4cba62e96..f944c6e48 100644 --- a/themoviedbapi/src/com/moviejukebox/themoviedb/tools/DOMParser.java +++ b/themoviedbapi/src/com/moviejukebox/themoviedb/tools/DOMParser.java @@ -136,16 +136,28 @@ public class DOMParser { subNode = subNodeList.item(nodeLoop); if (subNode.getNodeType() == Node.ELEMENT_NODE) { subElement = (Element) subNode; - Country country = new Country(); - - country.setName(DOMHelper.getValueFromElement(subElement, "name")); - country.setCode(DOMHelper.getValueFromElement(subElement, "code")); - country.setUrl(DOMHelper.getValueFromElement(subElement, "url")); - - movie.addProductionCountry(country); + + NodeList countryList = subNode.getChildNodes(); + for (int i = 0; i < countryList.getLength(); i++) { + Node countryNode = countryList.item(i); + if (countryNode.getNodeType() == Node.ELEMENT_NODE) { + subElement = (Element) countryNode; + Country country = new Country(); + + country.setName(subElement.getAttribute("name")); + country.setCode(subElement.getAttribute("code")); + country.setUrl(subElement.getAttribute("url")); + + System.out.println("Name: " + country.getName()); + System.out.println("Code: " + country.getCode()); + System.out.println("Url : " + country.getUrl()); + + movie.addProductionCountry(country); + } + } } } - + // Process the "cast" subNodeList = doc.getElementsByTagName("cast");