public void addTitles(SimpleModel model, Item item, BrandSummary list) { if (list == null || list.getTitle() == null) { model.put("primaryTitle", item.getTitle()); } else { model.put("primaryTitle", list.getTitle()); model.put("secondaryTitle", item.getTitle()); } model.put("title", item.getTitle()); model.put("titleTruncated", titleTruncator.truncatePossibleNull(item.getTitle())); Matcher seriesAndEpisodeMatcher = seriesAndEpisodeTitlePattern.matcher(item.getTitle()); Matcher episodeMatcher = episodeTitlePattern.matcher(item.getTitle()); model.put( "titleIsEpisodeNumber", seriesAndEpisodeMatcher.matches() || episodeMatcher.matches()); }
public SimpleModel build(Item item) { SimpleModel model = new SimpleModel(); BrandSummary brand = item.getBrandSummary(); model.put("uri", item.getUri()); model.put("thumbnail", item.getThumbnail()); if (item.getImage() != null) { model.put("image", item.getImage()); } else if (item.getThumbnail() != null) { model.put("image", item.getThumbnail()); } model.put("description", truncator.truncatePossibleNull(item.getDescription())); model.put("curie", item.getCurie()); model.put("externalUrl", item.getUri()); model.put("seriesNumber", item.getSeriesNumber()); model.put("episodeNumber", item.getEpisodeNumber()); addPublisher(model, item); addTitles(model, item, brand); addBrandSummary(model, brand); modelHelper.addGenres(model, item); modelHelper.addChannel(model, item); return model; }