From c04f330d5473e661cf6c818e82dcaa631f83218d Mon Sep 17 00:00:00 2001 From: Stuart Boston Date: Sun, 8 Nov 2015 16:43:46 +0000 Subject: [PATCH] Add setter for genre ids Used in the similar TV ATR --- .../com/omertron/themoviedbapi/model/tv/TVInfo.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/omertron/themoviedbapi/model/tv/TVInfo.java b/src/main/java/com/omertron/themoviedbapi/model/tv/TVInfo.java index a1f9d52ef..a4459d8e7 100644 --- a/src/main/java/com/omertron/themoviedbapi/model/tv/TVInfo.java +++ b/src/main/java/com/omertron/themoviedbapi/model/tv/TVInfo.java @@ -41,6 +41,7 @@ import com.omertron.themoviedbapi.results.WrapperGenericList; import com.omertron.themoviedbapi.results.WrapperImages; import com.omertron.themoviedbapi.results.WrapperTranslations; import java.io.Serializable; +import java.util.ArrayList; import java.util.Collections; import java.util.EnumSet; import java.util.List; @@ -230,6 +231,17 @@ public class TVInfo extends TVBasic implements Serializable, AppendToResponse + @JsonSetter("genre_ids") + public void setGenreIds(List ids) { + this.genres = new ArrayList<>(); + + for (Integer id : ids) { + Genre g = new Genre(); + g.setId(id); + genres.add(g); + } + } + private void addMethod(TVMethod method) { methods.add(method); }