diff --git a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java index 9995007..80e46c1 100644 --- a/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java +++ b/src/main/java/com/moparisthebest/rcrdit/RcrdIt.java @@ -75,6 +75,7 @@ import java.util.*; import java.util.stream.Collectors; import com.moparisthebest.rcrdit.requestbeans.GetScheduleRequest; import com.moparisthebest.rcrdit.responsebeans.GetScheduleResponse; +import org.glassfish.jersey.jackson.JacksonFeature; /** * Created by mopar on 2/16/17. @@ -103,6 +104,7 @@ public class RcrdIt extends ResourceConfig implements AutoCloseable { public RcrdIt(final File cfg) throws Exception { register(this); + register(JacksonFeature.class); final XmlElement rcrdit = AbstractXmlElement.getFactory().readFromFile(cfg); this.databaseUrl = rcrdit.getChild("databaseUrl").getValue(); diff --git a/src/main/java/com/moparisthebest/rcrdit/xmltv/Channel.java b/src/main/java/com/moparisthebest/rcrdit/xmltv/Channel.java index cc04a97..2e92963 100644 --- a/src/main/java/com/moparisthebest/rcrdit/xmltv/Channel.java +++ b/src/main/java/com/moparisthebest/rcrdit/xmltv/Channel.java @@ -43,7 +43,7 @@ public class Channel { this.displayNames = fromChannel.displayNames; this.id = fromChannel.id; List programsForNewChannel = new ArrayList<>(); - fromChannel.getPrograms().stream().filter((program) -> ((program.getStop().isAfter(startTime) && program.getStop().isBefore(stopTime)) || (program.getStart().isBefore(stopTime) && program.getStart().isAfter(startTime) ) || program.getStart().equals(startTime) || program.getStop().equals(stopTime) )).forEach((program) -> { + fromChannel.getPrograms().stream().filter((program) -> ((program.getStop().isAfter(startTime) && program.getStop().isBefore(stopTime)) || (program.getStart().isBefore(stopTime) && program.getStart().isAfter(startTime) )|| (program.getStart().isBefore(startTime) && program.getStop().isAfter(stopTime) ) || program.getStart().equals(startTime) || program.getStop().equals(stopTime) )).forEach((program) -> { programsForNewChannel.add(program); }); this.programs.addAll(programsForNewChannel);