private DateTime extractLastAvailabilityDate(Episode episode) { for (Version version : episode.getVersions()) { for (Encoding encoding : version.getManifestedAs()) { for (Location location : encoding.getAvailableAt()) { if (location.getPolicy() != null && Platform.XBOX.equals(location.getPolicy().getPlatform()) && location.getPolicy().getAvailabilityStart() != null) { return location.getPolicy().getAvailabilityEnd(); } } } } return null; }
private String extractAssetId(Episode episode) { for (Version version : episode.getVersions()) { for (Encoding encoding : version.getManifestedAs()) { for (Location location : encoding.getAvailableAt()) { if (location.getTransportType().equals(TransportType.LINK) && location.getPolicy() != null && Platform.XBOX.equals(location.getPolicy().getPlatform())) { Pattern pattern = Pattern.compile(".*asset/(\\d+).*"); Matcher matcher = pattern.matcher(location.getUri()); if (matcher.matches()) { return matcher.group(1); } } } } } return "NONE"; }