Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
 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";
 }