| | |
| | | package com.yeshi.buwan.util.factory; |
| | | |
| | | import com.yeshi.buwan.domain.video.InternetSearchVideo; |
| | | import com.yeshi.buwan.mogotv.entity.MogoTVClipInfo; |
| | | import com.yeshi.buwan.tencent.entity.TencentCoverInfo; |
| | | import com.yeshi.buwan.tencent.entity.TencentCoverVideo; |
| | | import com.yeshi.buwan.util.TimeUtil; |
| | | import com.yeshi.buwan.util.video.VideoConstant; |
| | | import com.yeshi.buwan.youku.entity.YouKuShowDetail; |
| | |
| | | return video; |
| | | } |
| | | |
| | | public static InternetSearchVideo create(MogoTVClipInfo detail) { |
| | | InternetSearchVideo video = new InternetSearchVideo(); |
| | | List<String> actors = new ArrayList<>(); |
| | | for (String st : detail.getLeader().split("/")) { |
| | | actors.add(st.trim()); |
| | | } |
| | | video.setActors(StringUtil.concat(actors, ",")); |
| | | video.setArea(detail.getArea()); |
| | | |
| | | |
| | | video.setDirector(detail.getDirector()); |
| | | video.setHpicture(detail.getHpicture()); |
| | | video.setVpicture(detail.getVpicture()); |
| | | video.setName(detail.getTitle()); |
| | | video.setNameStr(detail.getTitle()); |
| | | video.setResourceIds(26 + ""); |
| | | if (detail.getFstlvlType().equalsIgnoreCase("电影")) { |
| | | video.setRootType(VideoConstant.VIDEO_CATEGORY_DIANYING); |
| | | } else if (detail.getFstlvlType().equalsIgnoreCase("电视剧")) { |
| | | video.setRootType(VideoConstant.VIDEO_CATEGORY_DIANSHIJU); |
| | | } else if (detail.getFstlvlType().equalsIgnoreCase("动漫")) { |
| | | video.setRootType(VideoConstant.VIDEO_CATEGORY_DONGMAN); |
| | | } else if (detail.getFstlvlType().equalsIgnoreCase("综艺")) { |
| | | video.setRootType(VideoConstant.VIDEO_CATEGORY_ZONGYI); |
| | | } |
| | | if (detail.getFstlvlType().equalsIgnoreCase("电影")) { |
| | | video.setTag("评分:6.8"); |
| | | } else |
| | | video.setTag(detail.getUpdateInfo().split(",")[detail.getUpdateInfo().split(",").length - 1]); |
| | | video.setUpdateTime(new Date()); |
| | | video.setVideoCount(detail.getVideoCount()); |
| | | video.setYear(detail.getYear()); |
| | | video.setId(InternetSearchVideo.createId(video.getName(), video.getRootType(), video.getYear())); |
| | | return video; |
| | | } |
| | | |
| | | |
| | | public static InternetSearchVideo create(TencentCoverInfo info) { |
| | | |
| | | int videoCount = 0; |
| | | for (TencentCoverInfo.VipIdsBean idsBean : info.getVip_ids()) { |
| | | if (idsBean.getF() == 2 || idsBean.getF() == 7) |
| | | videoCount++; |
| | | } |
| | | |
| | | InternetSearchVideo video = new InternetSearchVideo(); |
| | | video.setActors(StringUtil.concat(info.getLeading_actor(), ",")); |
| | |
| | | } else |
| | | video.setTag(info.getEpisode_updated()); |
| | | video.setUpdateTime(new Date()); |
| | | video.setVideoCount(info.getVip_ids().size()); |
| | | video.setVideoCount(videoCount); |
| | | video.setYear(info.getYear()); |
| | | video.setId(InternetSearchVideo.createId(video.getName(), video.getRootType(), video.getYear())); |
| | | return video; |